Skip to content

Commit

Permalink
Merge branch 'check_if_node_exist'
Browse files Browse the repository at this point in the history
  • Loading branch information
ewoudwijma committed Jul 22, 2024
2 parents c5f0616 + 39b75f5 commit abee152
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions tools/webbundle.py
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)

0 comments on commit abee152

Please sign in to comment.