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

Use nodejs path list #19

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
12 changes: 10 additions & 2 deletions src/setup_build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ const npm = !Sys.iswindows() ? NodeJS_20_jll.npm : let
isfile(new) ? new : NodeJS_20_jll.npm
end

const npm_cmd = let
# Add NodeJS PATH to the existing PATH environment variable
path_sep = Sys.iswindows() ? ';' : ':'
path_list = prepend!(split(get(ENV, "PATH", ""), path_sep), NodeJS_20_jll.PATH_list)
fonsp marked this conversation as resolved.
Show resolved Hide resolved
path = join(path_list, path_sep)
addenv(`$(npm)`, "PATH" => path)
end

function get_build_dir()
build_node(@get_scratch!("build_dir3"))
end
Expand All @@ -29,8 +37,8 @@ function build_node(dir)
end

cd(dir) do
run(`$npm --version`)
run(`$npm install`)
run(`$npm_cmd --version`)
run(`$npm_cmd install`)
end

dir
Expand Down
Loading