Skip to content

Commit

Permalink
Add commands to bin file (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartijnCuppens authored Sep 18, 2019
1 parent d59a908 commit 13ea86b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 11 additions & 1 deletion bin/buildozer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#!/usr/bin/env node

if (process.argv.includes('build') || process.argv.includes('watch') || process.argv.includes('css') || process.argv.includes('img') || process.argv.includes('js') || process.argv.includes('clean')) {
function argsInclude(list) {
let value = false;
list.forEach(item => {
if (process.argv.includes(item)) {
value = true;
}
});
return value;
}

if (argsInclude(['build', 'watch', 'css', 'img', 'js', 'clean', 'copy', 'js-concat', 'svg-sprite'])) {
// Run gulp
require('../lib/gulp')();
} else if (process.argv.includes('config')) {
Expand Down
4 changes: 4 additions & 0 deletions lib/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ function getErrorMessage() {
error.push(`- ${chalk.bold('config')}: Export path config`);
error.push(`- ${chalk.bold('css')}: Compile only the CSS`);
error.push(`- ${chalk.bold('js')}: Compile only the javascript`);
error.push(`- ${chalk.bold('js-concat')}: Merge all .js files in concat folder`);
error.push(`- ${chalk.bold('img')}: Minify the images`);
error.push(`- ${chalk.bold('svg-sprite')}: Generate svg sprite`);
error.push(`- ${chalk.bold('clean')}: Clean all destination folders`);
error.push(`- ${chalk.bold('copy')}: Copy files defined in .buildozerrc`);
return chalk.red(`\n${error.join('\n')}`);
}

Expand Down

0 comments on commit 13ea86b

Please # to comment.