Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 64073cb

Browse files
committed
Merge pull request #80 from ipfs/cleanup
Fix linting issues and correct cli command descriptions and log names spaces
2 parents a419f04 + 8c7a486 commit 64073cb

File tree

9 files changed

+22
-22
lines changed

9 files changed

+22
-22
lines changed

src/cli/commands/bootstrap/add.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
const Command = require('ronin').Command
44
const IPFS = require('../../../ipfs-core')
55
const debug = require('debug')
6-
const log = debug('cli:version')
7-
log.error = debug('cli:version:error')
6+
const log = debug('cli:bootstrap')
7+
log.error = debug('cli:bootstrap:error')
88

99
module.exports = Command.extend({
10-
desc: 'Show peers in the bootstrap list',
10+
desc: 'Add peers to the bootstrap list',
1111

1212
options: {},
1313

src/cli/commands/bootstrap/list.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
const Command = require('ronin').Command
44
const IPFS = require('../../../ipfs-core')
55
const debug = require('debug')
6-
const log = debug('cli:version')
7-
log.error = debug('cli:version:error')
6+
const log = debug('cli:bootstrap')
7+
log.error = debug('cli:bootstrap:error')
88

99
module.exports = Command.extend({
1010
desc: 'Show peers in the bootstrap list',

src/cli/commands/bootstrap/rm.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
const Command = require('ronin').Command
44
const IPFS = require('../../../ipfs-core')
55
const debug = require('debug')
6-
const log = debug('cli:version')
7-
log.error = debug('cli:version:error')
6+
const log = debug('cli:bootstrap')
7+
log.error = debug('cli:bootstrap:error')
88

99
module.exports = Command.extend({
10-
desc: 'Show peers in the bootstrap list',
10+
desc: 'Removes peers from the bootstrap list',
1111

1212
options: {},
1313

src/cli/commands/commands.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const path = require('path')
55
const ronin = require('ronin')
66

77
module.exports = Command.extend({
8-
desc: '',
8+
desc: 'List all available commands',
99

1010
run: (name) => {
1111
const cli = ronin(path.resolve(__dirname, '..'))

src/cli/commands/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const log = debug('cli:config')
99
log.error = debug('cli:config:error')
1010

1111
module.exports = Command.extend({
12-
desc: 'Controls configuration variables.',
12+
desc: 'Get and set IPFS config values',
1313

1414
options: {
1515
bool: {

src/cli/commands/config/edit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const temp = require('temp')
77
const async = require('async')
88
const IPFS = require('../../../ipfs-core')
99
const debug = require('debug')
10-
const log = debug('cli:version')
11-
log.error = debug('cli:version:error')
10+
const log = debug('cli:config')
11+
log.error = debug('cli:config:error')
1212

1313
module.exports = Command.extend({
1414
desc: 'Opens the config file for editing in $EDITOR',

src/cli/commands/config/replace.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const Command = require('ronin').Command
44
const IPFS = require('../../../ipfs-core')
55
const debug = require('debug')
66
const path = require('path')
7-
const log = debug('cli:version')
8-
log.error = debug('cli:version:error')
7+
const log = debug('cli:config')
8+
log.error = debug('cli:config:error')
99

1010
module.exports = Command.extend({
1111
desc: 'Replaces the config with <file>',

src/cli/commands/config/show.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
const Command = require('ronin').Command
44
const IPFS = require('../../../ipfs-core')
55
const debug = require('debug')
6-
const log = debug('cli:version')
7-
log.error = debug('cli:version:error')
6+
const log = debug('cli:config')
7+
log.error = debug('cli:config:error')
88

99
module.exports = Command.extend({
1010
desc: 'Outputs the content of the config file',

tests/test-http-api/test-config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,13 @@ describe('config', () => {
154154
const form = new FormData()
155155
const headers = form.getHeaders()
156156

157-
streamToPromise(form).then(payload => {
157+
streamToPromise(form).then((payload) => {
158158
api.inject({
159159
method: 'POST',
160160
url: '/api/v0/config/replace',
161161
headers: headers,
162162
payload: payload
163-
}, res => {
163+
}, (res) => {
164164
expect(res.statusCode).to.equal(400)
165165
done()
166166
})
@@ -173,13 +173,13 @@ describe('config', () => {
173173
form.append('file', fs.createReadStream(filePath))
174174
const headers = form.getHeaders()
175175

176-
streamToPromise(form).then(payload => {
176+
streamToPromise(form).then((payload) => {
177177
api.inject({
178178
method: 'POST',
179179
url: '/api/v0/config/replace',
180180
headers: headers,
181181
payload: payload
182-
}, res => {
182+
}, (res) => {
183183
expect(res.statusCode).to.equal(500)
184184
done()
185185
})
@@ -193,13 +193,13 @@ describe('config', () => {
193193
const headers = form.getHeaders()
194194
const expectedConfig = JSON.parse(fs.readFileSync(filePath, 'utf8'))
195195

196-
streamToPromise(form).then(payload => {
196+
streamToPromise(form).then((payload) => {
197197
api.inject({
198198
method: 'POST',
199199
url: '/api/v0/config/replace',
200200
headers: headers,
201201
payload: payload
202-
}, res => {
202+
}, (res) => {
203203
expect(res.statusCode).to.equal(200)
204204
expect(updatedConfig()).to.deep.equal(expectedConfig)
205205
done()

0 commit comments

Comments
 (0)