Skip to content
Browse files

changed the order of execution

 split  and
  • Loading branch information...
1 parent 7dc3c93 commit 2d6be04d367dd607f7a3a15d88d7ef13b1b05526 @arunoda committed Oct 16, 2011
Showing with 12 additions and 13 deletions.
  1. +12 −13 lib/deployer.js
View
25 lib/deployer.js
@@ -42,29 +42,28 @@ function Deployer() {
logger.info('NO_DEPLOY exists, so abort');
callback(null, false);
} else {
- //execute `pre.sh`
- logger.info('executing pre.sh');
- self.executeIfExists(location, 'pre.sh', 'sh pre.sh', afterPreShExecuted);
+ //npm install
+ logger.info('executing npm install');
+ self.executeIfExists(location, 'package.json', 'npm install', afterNpmInstalled);
}
});
- function afterPreShExecuted(error, executed) {
+ function afterNpmInstalled(error, executed) {
if(!error) {
- //npm install
- logger.info('executing npm install');
- self.executeIfExists(location, 'package.json', 'npm install', afterNpmInstalled);
+ //execute pre.sh
+ logger.info('executing pre.sh');
+ self.executeIfExists(location, 'pre.sh', 'sh pre.sh', afterPreShExecuted);
} else {
- logger.error('error on executing pre.sh', {error: error});
- callback(wrapError('PRE_SH_ERROR', error));
+ logger.error('error on npm install', {error: error});
+ callback(wrapError('NPM_INSTALL_ERROR', error));
}
}
- function afterNpmInstalled(error, executed) {
+ function afterPreShExecuted(error, executed) {
if(!error) {
-
//starting the application (start.js)
logger.info('starting the application with start.js');
@@ -74,8 +73,8 @@ function Deployer() {
self.executeIfExists(location, 'start.js', appStartCommad, afterAppStarted);
} else {
- logger.error('error on npm install', {error: error});
- callback(wrapError('NPM_INSTALL_ERROR', error));
+ logger.error('error on executing pre.sh', {error: error});
+ callback(wrapError('PRE_SH_ERROR', error));
}
}

0 comments on commit 2d6be04

Please sign in to comment.
Something went wrong with that request. Please try again.