From 63605d0422986883633fb77967710edbebd14c30 Mon Sep 17 00:00:00 2001 From: Richard Gustin Date: Fri, 6 Jun 2014 06:32:12 +1000 Subject: [PATCH] fix(windows): Fixed delimiter for NODE_PATH on windows --- app.js | 8 ++++++-- package.json | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index 3dfd806..ce83795 100644 --- a/app.js +++ b/app.js @@ -2,6 +2,8 @@ var cluster = require( 'cluster' ) , config = require( './config' ) , packageJson = require( './package.json' ) , path = require( 'path' ) + , os = require( 'os' ) + , isWin = /^win32/.test( os.platform() ) , fs = require( 'fs' ); function loadModulesAppFiles( moduleName ) { @@ -13,8 +15,10 @@ function loadModulesAppFiles( moduleName ) { }); } -// Set the node path - this works only because the other processes are forked. -process.env.NODE_PATH = process.env.NODE_PATH ? './lib/:./modules/:' + process.env.NODE_PATH : './lib/:./modules/'; +// Set the node path - this works only because the other processes are forked. (Be sure to use the right delimiter) +process.env.NODE_PATH = process.env.NODE_PATH + ? [ './lib/', './modules', process.env.NODE_PATH ].join( isWin ? ';' : ':' ) + : [ './lib/', './modules' ].join( isWin ? ';' : ':' ); if ( cluster.isMaster ) { cluster.on('exit', function( worker, code, signal ) { diff --git a/package.json b/package.json index 8e967fc..f13d69e 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,14 @@ "main": "app.js", "name": "node-seed", "description": "Cleverstack Node-Seed", - "version": "0.1.4", + "version": "0.1.5", "author": { "name": "CleverStack", "email": "admin@cleverstack.io", "web": "http://cleverstack.io" }, "collaborators": [ - "Richard Gustin ", + "Richard Gustin ", "Dmitry Bashkatov ", "Leandro Ostera " ],