Skip to content

Commit

Permalink
[fix] deploys without confirming if release is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
dscape committed Jul 16, 2013
1 parent 4832b63 commit e94b778
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions lib/jitsu/package.js
Expand Up @@ -272,23 +272,7 @@ package.validate = function (pkg, dir, options, callback) {
// create operation in the specified `dir`.
//
package.write = function (pkg, dir, create, callback) {
if (!callback) {
callback = create;
create = null;
}

delete pkg.analyzed;

jitsu.log.warn('About to write ' + path.join(dir, 'package.json').magenta);

//
// analyze and throw warnings if any dependencies have version of '*'
//
policeDependencies(pkg);

jitsu.inspect.putObject(pkg, 2);

jitsu.prompt.confirm('Is this ' + 'ok?'.green.bold, { default: 'yes'}, function (err, result) {
function doWrite(err, result) {
if (err) {
return cb(err);
}
Expand All @@ -303,8 +287,27 @@ package.write = function (pkg, dir, create, callback) {
return err ? callback(err) : callback(null, pkg, dir);
});
});
}

});
if (!callback) {
callback = create;
create = null;
}

delete pkg.analyzed;

jitsu.log.warn('About to write ' + path.join(dir, 'package.json').magenta);

//
// analyze and throw warnings if any dependencies have version of '*'
//
policeDependencies(pkg);

jitsu.inspect.putObject(pkg, 2);

return jitsu.argv.release
? doWrite(null, true)
: jitsu.prompt.confirm('Is this ' + 'ok?'.green.bold, { default: 'yes'}, doWrite);
};

//
Expand Down

0 comments on commit e94b778

Please sign in to comment.