Skip to content

Commit

Permalink
Merge pull request #353 from broccolijs/improvements
Browse files Browse the repository at this point in the history
Improvements
  • Loading branch information
stefanpenner authored Dec 22, 2017
2 parents d10b18c + e1a193e commit 50053f6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ module.exports = function broccoliCLI(args) {

program
.command('build [target]')
.alias('b')
.description('output files to target directory')
.option('--brocfile-path <path>', 'the path to brocfile')
.option('--output-path <path>', 'the path to target output folder')
Expand All @@ -63,6 +64,10 @@ module.exports = function broccoliCLI(args) {
outputDir = options.outputPath;
}

if (!outputDir) {
outputDir = 'dist';
}

guardOutputDir(outputDir);

const builder = getBuilder({ brocfilePath: options.brocfilePath });
Expand Down
6 changes: 6 additions & 0 deletions test/cli_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ describe('cli', function() {
});
});

it('supports `b` alias', function() {
return cli(['node', 'broccoli', 'b']).then(() => {
chai.expect(exitStub).to.be.calledWith(0);
});
});

context('with param --output-path', function() {
it('closes process on completion', function() {
return cli(['node', 'broccoli', 'build', '--output-path', 'dist']).then(() => {
Expand Down

0 comments on commit 50053f6

Please sign in to comment.