hoodie-cli
Advanced tools
Comparing version 0.4.17 to 0.5.0
@@ -0,1 +1,10 @@ | ||
<a name="0.5.0"></a> | ||
## 0.5.0 (2014-07-17) | ||
#### Features | ||
* **options:** Allow users to specify custom ports with hoodie start. ([dd14ec59](https://github.com/hoodiehq/hoodie-cli/commit/dd14ec597722f45e41015574eec993a6d2bdcbe6)) | ||
<a name="0.4.17"></a> | ||
@@ -2,0 +11,0 @@ ### 0.4.17 (2014-07-14) |
@@ -8,9 +8,24 @@ Starts newly created hoodie app. | ||
$0 start -w | --www <directory> | ||
$0 start -c | --custom-ports <www_port>,<admin_port>,<couch_port> | ||
Options: | ||
-n | --nobrowser Whether to open browser upon hoodie start. | ||
-s | --allow-sudo Allow to start the app as a sudoer. | ||
-w | --www Set the directory hoodie will serve static assets from. | ||
-n | --nobrowser Whether to open browser upon hoodie start. | ||
-s | --allow-sudo Allow to start the app as a sudoer. | ||
-w | --www Set the directory hoodie will serve static assets from. | ||
-c | --custom-ports Allow user-specified ports (www,admin,couch). | ||
Arguments: | ||
<directory> Directory from where hoodie will serve static assets. | ||
<www_port> Port number at which hoodie will serve the user's application. | ||
<admin_port> Port number at which hoodie will serve the Admin Dashboard. | ||
<couch_port> Port number at which hoodie will serve CouchDB. | ||
Examples: | ||
$ $0 start | ||
$ $0 start --nobrowser | ||
$ $0 start -n | ||
$ $0 start -w "production" | ||
$ $0 start --allow-sudo | ||
$ $0 start -s | ||
$ $0 start --custom-ports 7777,8888,9999 |
@@ -30,3 +30,4 @@ var hoodie = require('../main'); | ||
www: argv.www || argv.w, | ||
sudo: argv['allow-sudo'] || argv.s | ||
sudo: argv['allow-sudo'] || argv.s, | ||
custom_ports: argv['custom-ports'] || argv.c | ||
}; | ||
@@ -33,0 +34,0 @@ |
@@ -76,2 +76,7 @@ var Command = require('./util/command'); | ||
} | ||
// configure custom ports | ||
if (options.custom_ports) { | ||
processArgs.push('--custom_ports', options.custom_ports); | ||
self.hoodie.emit('info', 'Serving hoodie on custom ports ' + options.custom_ports); | ||
} | ||
@@ -78,0 +83,0 @@ // forks hoodie app and listens for messages |
{ | ||
"name": "hoodie-cli", | ||
"description": "Hoodie command-line interface.", | ||
"version": "0.4.17", | ||
"version": "0.5.0", | ||
"preferGlobal": true, | ||
@@ -6,0 +6,0 @@ "dependencies": { |
@@ -61,3 +61,4 @@ var hoodie = require('../../lib/main'); | ||
www: undefined, | ||
sudo: undefined | ||
sudo: undefined, | ||
custom_ports: undefined | ||
}; | ||
@@ -75,3 +76,4 @@ cli.argv({ _: ['start'] }); | ||
www: undefined, | ||
sudo: undefined | ||
sudo: undefined, | ||
custom_ports: undefined | ||
}; | ||
@@ -89,3 +91,4 @@ cli.argv({ _: ['start'], noBrowser: true}); | ||
www: undefined, | ||
sudo: undefined | ||
sudo: undefined, | ||
custom_ports: undefined | ||
}; | ||
@@ -103,3 +106,4 @@ cli.argv({ _: ['start'], noBrowser: true }); | ||
www: 'production', | ||
sudo: undefined | ||
sudo: undefined, | ||
custom_ports: undefined | ||
}; | ||
@@ -112,2 +116,16 @@ cli.argv({ _: ['start'], noBrowser: true, www: 'production'}); | ||
describe('$ hoodie start --custom-ports "6666,7777,8888"', function() { | ||
it('should try to start the app with --custom-ports', function() { | ||
var args = { | ||
noBrowser: undefined, | ||
www: undefined, | ||
sudo: undefined, | ||
custom_ports: "6666,7777,8888" | ||
}; | ||
cli.argv({ _: ['start'], "custom-ports": "6666,7777,8888"}); | ||
expect(hoodie.start.args[0][0]).to.eql(args); | ||
expect(hoodie.start.args[0][1]).to.be.a('function'); | ||
}); | ||
}); | ||
}); |
107677
2390