fix(traverse): do not publish the build script

This commit is contained in:
Boshen 2024-06-08 16:31:21 +08:00
parent 053f19dd19
commit 48bb97e53a
No known key found for this signature in database
GPG key ID: 9C7A8C8AB22BEBD1
2 changed files with 9 additions and 11 deletions

View file

@ -11,6 +11,7 @@ license.workspace = true
repository.workspace = true
rust-version.workspace = true
categories.workspace = true
include = ["/src"]
[lints]
workspace = true

View file

@ -1,20 +1,17 @@
use std::{env, process::Command};
fn main() {
// 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.
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");
// 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,
_ => {}
}
// 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");