Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate installed emsdk version #2256

Merged
merged 4 commits into from
Jun 15, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Activate emsdk version from package.json
This ensures that the version installed on a developer's clone
matches what's in package.json

may want to catch the error + add some instructions to fix the
problem
  • Loading branch information
tomjakubowski committed Jun 13, 2023
commit d86d8d373265664585c48af7a5a7e590e5c27b0d
13 changes: 8 additions & 5 deletions scripts/run_emsdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ const path = require("path");
try {
const cwd = process.cwd();
const cmd = process.argv.slice(2).join(" ");
const scripts = __dirname;
const emsdkdir = path.join(scripts, "..", ".emsdk");
const emversion = require("../package.json").emscripten;
const emsdkdir = path.join(__dirname, "..", ".emsdk");
const emversion = require(path.join(
__dirname,
"..",
"package.json"
)).emscripten;
if (!emversion) {
throw new Error("emscripten version not specified in package.json");
throw new Error("Emscripten version not specified in package.json");
}
execute_throw`${scripts}/with_emsdk.sh ${emsdkdir} ${emversion} ${cmd}`;
execute_throw`cd ${emsdkdir} && . ./emsdk_env.sh >/dev/null 2>&1 && emsdk activate ${emversion} >/dev/null && cd ${cwd} && ${cmd}`;
} catch (e) {
console.log(e.message);
process.exit(1);
Expand Down