Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add commands to bin file #15

Merged
merged 1 commit into from
Sep 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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