Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Default "working directory" to the script directory (POLS)

  • Loading branch information...
commit 2ea9e7d67746315e7526b40edc9c46654072e7d3 1 parent 7ede5b1
@tj tj authored
Showing with 4 additions and 3 deletions.
  1. +1 −1  docs/api.md
  2. +2 −2 lib/master.js
  3. +1 −0  test/test.basic.js
View
2  docs/api.md
@@ -43,7 +43,7 @@
Below are the settings available:
- `workers` Number of workers to spawn, defaults to the number of CPUs or `1`
- - `working directory` Working directory defaulting to `/`
+ - `working directory` Working directory defaulting to the script's dir
- `backlog` Connection backlog, defaulting to 128
- `socket path` Master socket path defaulting to `./`
- `timeout` Worker shutdown timeout in milliseconds, defaulting to `60000`
View
4 lib/master.js
@@ -45,7 +45,7 @@ var node = process.execPath
* Options:
*
* - `workers` Number of workers to spawn, defaults to the number of CPUs
- * - 'working directory` Working directory defaulting to '/'
+ * - 'working directory` Working directory defaulting to the script's dir
* - 'backlog` Connection backlog, defaulting to 128
* - 'socket path` Master socket path defaulting to `./`
* - 'timeout` Worker shutdown timeout in milliseconds, defaulting to 60000
@@ -93,7 +93,7 @@ var Master = module.exports = function Master(server) {
// defaults
this.options = {
'backlog': 128
- , 'working directory': '/'
+ , 'working directory': this.dir
, 'socket path': this.dir
, 'timeout': 60000
};
View
1  test/test.basic.js
@@ -17,6 +17,7 @@ cluster = cluster(server)
.listen(3000);
cluster.on('listening', function(){
+ process.cwd().should.include.string('cluster/test');
http.get({ host: 'localhost', port: 3000 }, function(res){
res.on('data', function(chunk){
chunk.toString().should.equal('Hello World');
Please sign in to comment.
Something went wrong with that request. Please try again.