feat: add self-contained offline development resources
Some checks failed
real-verification / chrome (push) Has been cancelled
real-verification / freecad-oracle (push) Has been cancelled
real-verification / wasm (push) Has been cancelled

This commit is contained in:
2026-08-12 02:36:09 -04:00
parent 97967041e2
commit ca6fe46030
14 changed files with 1102 additions and 12 deletions

View File

@@ -24,6 +24,8 @@ esac
archive_name="node-v${NODE_VERSION}-${platform}-${arch}.${archive_ext}"
archive_path="$runtime_root/downloads/$archive_name"
runtime_dir="$runtime_root/node-v${NODE_VERSION}-${platform}-${arch}"
resource_home="${WEB_FREECAD_RESOURCE_LIBRARY:-${HOME}/resource-library/web-freecad-bitbybit}"
resource_archive="$resource_home/toolchains/node/$archive_name"
if [ -x "$runtime_dir/bin/node" ] && [ "$($runtime_dir/bin/node --version)" = "v$NODE_VERSION" ]; then
printf '%s\n' "$runtime_dir"
@@ -41,6 +43,15 @@ if [ -e "$archive_path" ]; then
fi
fi
if [ ! -e "$archive_path" ] && [ -e "$resource_archive" ]; then
cp "$resource_archive" "$archive_path"
fi
if [ ! -e "$archive_path" ] && { [ "${WEB_FREECAD_OFFLINE:-0}" = "1" ] || [ "${npm_config_offline:-false}" = "true" ]; }; then
echo "Pinned Node archive is unavailable in the offline resource library: $resource_archive" >&2
exit 2
fi
if [ ! -e "$archive_path" ]; then
temp_archive="$archive_path.part"
rm -f "$temp_archive"