Skip to content

Commit

Permalink
Allow dist.baseDir to be falsey: don't create/stage the dir (resolves #…
Browse files Browse the repository at this point in the history
  • Loading branch information
webpro committed Sep 9, 2015
1 parent 9939919 commit 71a3c7f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions lib/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ function popd() {

function build(command, dir) {
tracker._track('npm', 'run-script');
return command ? sequence([
run.bind(null, 'rm', '-rf', dir),
run.bind(null, 'mkdir', '-p', dir),
run.bind(null, command)
]) : noop.then(function() {
var commands = [];
if(dir) {
commands.push(run.bind(null, 'rm', '-rf', dir));
commands.push(run.bind(null, 'mkdir', '-p', dir));
}
commands.push(run.bind(null, command));
return command ? sequence(commands) : noop.then(function() {
log.verbose('No build command was provided.');
});
}
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ function getGenericTasks(options) {

function getSrcRepoTasks(options) {

var isStageBuildDir = !!options.buildCommand && !options.dist.repo,
var isStageBuildDir = !!options.buildCommand && !options.dist.repo && options.dist.baseDir,
isPublish = !options['non-interactive'] || (options.npm.publish && !options.dist.repo);

return _.extend({}, getGenericTasks(options), {
Expand Down

0 comments on commit 71a3c7f

Please sign in to comment.