Skip to content

Commit

Permalink
fix(traverse): do not publish the build script
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Jun 8, 2024
1 parent 053f19d commit 48bb97e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
1 change: 1 addition & 0 deletions crates/oxc_traverse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ license.workspace = true
repository.workspace = true
rust-version.workspace = true
categories.workspace = true
include = ["/src"]

[lints]
workspace = true
Expand Down
17 changes: 7 additions & 10 deletions crates/oxc_traverse/build.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
use std::{env, process::Command};

fn main() {
// Re-run if NodeJS build script or AST types change
println!("cargo:rerun-if-changed=scripts");
println!("cargo:rerun-if-changed=../oxc_ast/src/ast");

// Exit if on CI.
// The built files should be checked into git, so want to run tests etc on what's actually in repo,
// rather than regenerating them.
match env::var("CI") {
Ok(value) if value == "true" => return,
_ => {}
if std::option_env!("CI") == Some("true") {
return;
}

// Re-run if NodeJS build script or AST types change
println!("cargo:rerun-if-changed=scripts");
println!("cargo:rerun-if-changed=../oxc_ast/src/ast");

// Run NodeJS build script
let status = Command::new("node")
let status = std::process::Command::new("node")
.arg("./scripts/build.mjs")
.status()
.expect("Failed to run NodeJS build script");
Expand Down

0 comments on commit 48bb97e

Please sign in to comment.