-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
Import("env") | ||
import shutil | ||
|
||
# Install the necessary node packages for the pre-build asset bundling script | ||
env.Execute("npm install") | ||
cmd_ex = shutil.which("node") | ||
# Check if Node.js is not installed | ||
if cmd_ex is None: | ||
print('\x1b[0;31;43m' + 'Node.js is not installed or missing from PATH changes to html css js will not be processed' + '\x1b[0m') | ||
else: | ||
# Install the necessary node packages for the pre-build asset bundling script | ||
print('\x1b[6;33;42m' + 'Install the node packages' + '\x1b[0m') | ||
|
||
# Call the bundling script | ||
exitCode = env.Execute("node tools/cdata.js") | ||
# npm ci performs a clean install of all existing dependencies | ||
env.Execute("npm ci") | ||
|
||
# If it failed, abort the build | ||
if (exitCode): | ||
Exit(exitCode) | ||
# Call the bundling script | ||
exitCode = env.Execute("node tools/cdata.js") | ||
|
||
# If it failed, abort the build | ||
if (exitCode): | ||
Exit(exitCode) |