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

Fix linting issues and correct cli command descriptions and log names spaces #80

Merged
merged 1 commit into from
Mar 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/cli/commands/bootstrap/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
const Command = require('ronin').Command
const IPFS = require('../../../ipfs-core')
const debug = require('debug')
const log = debug('cli:version')
log.error = debug('cli:version:error')
const log = debug('cli:bootstrap')
log.error = debug('cli:bootstrap:error')

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

options: {},

Expand Down
4 changes: 2 additions & 2 deletions src/cli/commands/bootstrap/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
const Command = require('ronin').Command
const IPFS = require('../../../ipfs-core')
const debug = require('debug')
const log = debug('cli:version')
log.error = debug('cli:version:error')
const log = debug('cli:bootstrap')
log.error = debug('cli:bootstrap:error')

module.exports = Command.extend({
desc: 'Show peers in the bootstrap list',
Expand Down
6 changes: 3 additions & 3 deletions src/cli/commands/bootstrap/rm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
const Command = require('ronin').Command
const IPFS = require('../../../ipfs-core')
const debug = require('debug')
const log = debug('cli:version')
log.error = debug('cli:version:error')
const log = debug('cli:bootstrap')
log.error = debug('cli:bootstrap:error')

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

options: {},

Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require('path')
const ronin = require('ronin')

module.exports = Command.extend({
desc: '',
desc: 'List all available commands',

run: (name) => {
const cli = ronin(path.resolve(__dirname, '..'))
Expand Down
2 changes: 1 addition & 1 deletion src/cli/commands/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const log = debug('cli:config')
log.error = debug('cli:config:error')

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

options: {
bool: {
Expand Down
4 changes: 2 additions & 2 deletions src/cli/commands/config/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const temp = require('temp')
const async = require('async')
const IPFS = require('../../../ipfs-core')
const debug = require('debug')
const log = debug('cli:version')
log.error = debug('cli:version:error')
const log = debug('cli:config')
log.error = debug('cli:config:error')

module.exports = Command.extend({
desc: 'Opens the config file for editing in $EDITOR',
Expand Down
4 changes: 2 additions & 2 deletions src/cli/commands/config/replace.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const Command = require('ronin').Command
const IPFS = require('../../../ipfs-core')
const debug = require('debug')
const path = require('path')
const log = debug('cli:version')
log.error = debug('cli:version:error')
const log = debug('cli:config')
log.error = debug('cli:config:error')

module.exports = Command.extend({
desc: 'Replaces the config with <file>',
Expand Down
4 changes: 2 additions & 2 deletions src/cli/commands/config/show.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
const Command = require('ronin').Command
const IPFS = require('../../../ipfs-core')
const debug = require('debug')
const log = debug('cli:version')
log.error = debug('cli:version:error')
const log = debug('cli:config')
log.error = debug('cli:config:error')

module.exports = Command.extend({
desc: 'Outputs the content of the config file',
Expand Down
12 changes: 6 additions & 6 deletions tests/test-http-api/test-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,13 @@ describe('config', () => {
const form = new FormData()
const headers = form.getHeaders()

streamToPromise(form).then(payload => {
streamToPromise(form).then((payload) => {
api.inject({
method: 'POST',
url: '/api/v0/config/replace',
headers: headers,
payload: payload
}, res => {
}, (res) => {
expect(res.statusCode).to.equal(400)
done()
})
Expand All @@ -173,13 +173,13 @@ describe('config', () => {
form.append('file', fs.createReadStream(filePath))
const headers = form.getHeaders()

streamToPromise(form).then(payload => {
streamToPromise(form).then((payload) => {
api.inject({
method: 'POST',
url: '/api/v0/config/replace',
headers: headers,
payload: payload
}, res => {
}, (res) => {
expect(res.statusCode).to.equal(500)
done()
})
Expand All @@ -193,13 +193,13 @@ describe('config', () => {
const headers = form.getHeaders()
const expectedConfig = JSON.parse(fs.readFileSync(filePath, 'utf8'))

streamToPromise(form).then(payload => {
streamToPromise(form).then((payload) => {
api.inject({
method: 'POST',
url: '/api/v0/config/replace',
headers: headers,
payload: payload
}, res => {
}, (res) => {
expect(res.statusCode).to.equal(200)
expect(updatedConfig()).to.deep.equal(expectedConfig)
done()
Expand Down