Skip to content

Commit b357233

Browse files
committed
fix: run rm.js from the package root, drop the ignored copySync arg
The conda-lock and extract scripts cd into a subdir first and then called node scripts/rm.js, but that path only resolves from the repo root, so the removal failed with a module-not-found once the cwd changed. npm and yarn always start a run-script at the package root, so the natural fix is to do the removal there against a root-relative target and let the later cd handle only conda-lock and tar, which genuinely need the subdir. This avoids a ../scripts/rm.js form that would recouple the path to the cd depth. copySync already hardcodes { recursive: true } in its definition, so the third argument passed at the copy-extras call site was silently ignored; removing it keeps the recursive copy and drops the misleading option. Note: AI-assisted (Claude Code). Manually verified: rm.js from root cwd with a subdir glob and a glob-miss both remove the right paths and exit 0; copySync copies a nested tree; type-check, 443 unit tests and yarn build all pass on the merged branch.
1 parent fdfa121 commit b357233

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@
3030
"dist:osx-arm64-dev": "yarn build && CSC_IDENTITY_AUTO_DISCOVERY=false electron-builder --macos --arm64 --publish never",
3131
"dist:win-64": "yarn build && electron-builder --win --publish never",
3232
"dist:win-arm64": "yarn build && yarn electron-builder --arm64 --publish never",
33-
"update_workflow_conda_lock": "cd workflow_env && node scripts/rm.js *.lock && conda-lock --kind explicit -f publish_env.yaml && cd -",
34-
"update_conda_lock": "cd env_installer && node scripts/rm.js *.lock && conda-lock --kind explicit -f jlab_server.yaml && cd -",
33+
"update_workflow_conda_lock": "node scripts/rm.js workflow_env/*.lock && cd workflow_env && conda-lock --kind explicit -f publish_env.yaml && cd -",
34+
"update_conda_lock": "node scripts/rm.js env_installer/*.lock && cd env_installer && conda-lock --kind explicit -f jlab_server.yaml && cd -",
3535
"clean_env_installer": "node scripts/rm.js ./env_installer/jlab_server.tar.gz && node scripts/rm.js ./env_installer/jlab_server",
3636
"create_env_installer": "yarn clean_env_installer && conda-lock install --no-validate-platform --prefix ./env_installer/jlab_server ./env_installer/conda-${ENV_PLATFORM}.lock && yarn copy_extras_to_bundled_env && conda pack -p ./env_installer/jlab_server -o ./env_installer/jlab_server.tar.gz",
3737
"create_env_installer:linux-64": "ENV_PLATFORM=linux-64 yarn create_env_installer",
3838
"create_env_installer:linux-aarch64": "ENV_PLATFORM=linux-aarch64 yarn create_env_installer",
3939
"create_env_installer:osx-64": "ENV_PLATFORM=osx-64 yarn create_env_installer",
4040
"create_env_installer:osx-arm64": "ENV_PLATFORM=osx-arm64 yarn create_env_installer",
4141
"create_env_installer:win-64": "yarn clean_env_installer && conda-lock install --no-validate-platform --prefix ./env_installer/jlab_server ./env_installer/conda-win-64.lock && yarn copy_extras_to_bundled_env && conda pack -p ./env_installer/jlab_server -o ./env_installer/jlab_server.tar.gz",
42-
"extract_env_installer:osx": "cd ./env_installer && node scripts/rm.js jlab_server_extracted && mkdir jlab_server_extracted && tar -xzf jlab_server.tar.gz -C jlab_server_extracted && cd -",
42+
"extract_env_installer:osx": "node scripts/rm.js env_installer/jlab_server_extracted && cd ./env_installer && mkdir jlab_server_extracted && tar -xzf jlab_server.tar.gz -C jlab_server_extracted && cd -",
4343
"extract_env_installer:osx-64": "yarn extract_env_installer:osx",
4444
"extract_env_installer:osx-arm64": "yarn extract_env_installer:osx",
4545
"compress_env_installer:osx": "node scripts/rm.js ./env_installer/jlab_server.tar.gz && cd ./env_installer/jlab_server_extracted && tar -czf ../jlab_server.tar.gz . && cd -",

scripts/buildutil.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ if (flags['copy-extras-to-bundled-env']) {
167167
const envExtrasDir = path.resolve('env_installer', 'extras');
168168
const envInstallerDir = path.resolve('env_installer', 'jlab_server');
169169

170-
copySync(envExtrasDir, envInstallerDir, { recursive: true });
170+
copySync(envExtrasDir, envInstallerDir);
171171

172172
console.log(
173173
`Finished copying env extras from \n\t"${envExtrasDir}" to \n\t"${envInstallerDir}"`

0 commit comments

Comments
 (0)