Skip to content

Commit

Permalink
revert: remove debug scripts in build.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonVirgo committed Jul 17, 2024
1 parent b051edb commit 00fb5bf
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
use std::env;
use std::fs;
use std::path::{Path, PathBuf};
use std::process::Command;

fn copy_dir_all(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> std::io::Result<()> {
fs::create_dir_all(&dst)?;
for entry in fs::read_dir(src)? {
let entry = entry?;
let file_type = entry.file_type()?;
if file_type.is_dir() {
copy_dir_all(entry.path(), dst.as_ref().join(entry.file_name()))?;
} else {
fs::copy(entry.path(), dst.as_ref().join(entry.file_name()))?;
}
}
Ok(())
}

fn main() {
Command::new("npm")
.arg("install")
Expand All @@ -37,8 +20,4 @@ fn main() {
if !output.status.success() {
eprintln!("Error: {}", String::from_utf8_lossy(&output.stderr));
}

let out_dir = env::var("OUT_DIR").unwrap();
let dest_dir = PathBuf::from(out_dir).join("static");
copy_dir_all("static", &dest_dir).unwrap();
}

0 comments on commit 00fb5bf

Please sign in to comment.