diff options
author | Solly Ross <sross@redhat.com> | 2017-10-03 18:21:36 -0400 |
---|---|---|
committer | Solly Ross <sross@redhat.com> | 2017-10-03 18:21:36 -0400 |
commit | c4e5a50e09fe44f17c3ac7f81a36b2a9146c3b21 (patch) | |
tree | 7301018a66fc525830aca446d63ef11ce28189e2 /utils | |
parent | b1e26cf4e7fc9e9041e6189827f7e47b119ca481 (diff) | |
download | novnc-c4e5a50e09fe44f17c3ac7f81a36b2a9146c3b21.tar.gz |
[infra] option to clean on use_require.js
This adds an option to `utils/use_require.js` which cleans the lib
and build directories before regenerating them. This will enable us
to make sure we always have a fresh copy of the lib dir before
publishing.
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/use_require.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/utils/use_require.js b/utils/use_require.js index 30d4cbd..fea1b1d 100755 --- a/utils/use_require.js +++ b/utils/use_require.js @@ -11,6 +11,7 @@ program .option('--as [format]', `output files using various import formats instead of ES6 import and export. Supports ${Array.from(SUPPORTED_FORMATS)}.`) .option('-m, --with-source-maps [type]', 'output source maps when not generating a bundled app (type may be empty for external source maps, inline for inline source maps, or both) ') .option('--with-app', 'process app files as well as core files') + .option('--clean', 'clear the lib folder before building') .parse(process.argv); // the various important paths @@ -177,4 +178,12 @@ var make_lib_files = function (import_format, source_maps, with_app_dir) { } }; +if (program.clean) { + console.log(`Removing ${paths.lib_dir_base}`); + fse.removeSync(paths.lib_dir_base); + + console.log(`Removing ${paths.out_dir_base}`); + fse.removeSync(paths.out_dir_base); +} + make_lib_files(program.as, program.withSourceMaps, program.withApp); |