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

fix windows npm #448

Merged
merged 3 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
29 changes: 22 additions & 7 deletions neptune/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,39 @@ fn copy_mega_apps() {
}
}

/// run npm install in the libs/ztm
fn run_npm_install() {
#[cfg(any(target_os = "linux", target_os = "macos"))]
let _ = std::process::Command::new("npm")
.current_dir("libs/ztm/pipy")
.arg("install")
.output()
.expect("failed to run npm install in ztm/pipy");

#[cfg(target_os = "windows")]
let _ = std::process::Command::new("cmd.exe")
.current_dir("libs/ztm/pipy")
// .arg("install")
.arg("/C")
.arg("npm install")
.output()
.expect("failed to run npm install in ztm/pipy");
}

fn main() {
// check submodule exists
let check_file = Path::new("libs/ztm/pipy/CMakeLists.txt");
if !check_file.exists() {
panic!("Please run `git submodule update --init --recursive` to get the submodule");
}

copy_mega_apps();

build_agent_ui();

run_npm_install();

/* compile ztm & pipy */
// run npm install in the libs/ztm
let _ = std::process::Command::new("npm")
.current_dir("libs/ztm/pipy")
.arg("install")
.output()
.expect("failed to run npm install in ztm/pipy");

let mut config = Config::new("libs/ztm/pipy");

// set to use clang/clang++ to compile
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading