Skip to content

Commit

Permalink
Making clearing the current build in the neu build command optional (
Browse files Browse the repository at this point in the history
…#259)

* added option to clear the current build

* Update build.js

---------

Co-authored-by: Shalitha Suranga <shalithasuranga@gmail.com>
  • Loading branch information
Sadaf-A and shalithasuranga committed May 6, 2024
1 parent 318d3e4 commit 2d9faf2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/commands/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ module.exports.register = (program) => {
.description('builds binaries for all supported platforms and resources.neu file')
.option('-r, --release')
.option('--copy-storage')
.option('--clean')
.action(async (command) => {
utils.checkCurrentProject();
const configObj = config.get()
utils.log('Removing current build...');
const buildDir = configObj.cli.distributionPath ? utils.trimPath(configObj.cli.distributionPath) : 'dist';
utils.clearDirectory(buildDir);
if(command.clean) {
utils.log(`Cleaning current build files from ${buildDir}...`);
utils.clearDirectory(buildDir);
}
utils.log('Bundling app...');
await bundler.bundleApp(command.release, command.copyStorage);
utils.showArt();
Expand Down

0 comments on commit 2d9faf2

Please sign in to comment.