Skip to content

Commit

Permalink
Code formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
koxu1996 committed Jul 30, 2024
1 parent 92f9ae5 commit 2eda67a
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions kairos-cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,26 @@ fn main() {
println!("cargo:rerun-if-env-changed=PATH_TO_SESSION_BINARIES");

// Determine the session binaries directory.
let (is_automatic_path, session_binaries_dir) = if let Ok(session_code_dir) = env::var("PATH_TO_SESSION_BINARIES") {
(false, PathBuf::from(session_code_dir))
} else {
// Run `cargo build --release` if the environment variable is not set.
println!("cargo:warning=Building session code dependency.");
let project_root = env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| ".".to_string());
let status = Command::new("cargo")
.arg("build")
.arg("--release")
.current_dir(Path::new(&project_root).join("../kairos-session-code"))
.status()
.expect("Failed to execute cargo build --release");

if !status.success() {
panic!("cargo build --release failed");
}
let (is_automatic_path, session_binaries_dir) =
if let Ok(session_code_dir) = env::var("PATH_TO_SESSION_BINARIES") {
(false, PathBuf::from(session_code_dir))
} else {
// Run `cargo build --release` if the environment variable is not set.
println!("cargo:warning=Building session code dependency.");
let project_root = env::var("CARGO_MANIFEST_DIR").unwrap_or_else(|_| ".".to_string());
let status = Command::new("cargo")
.arg("build")
.arg("--release")
.current_dir(Path::new(&project_root).join("../kairos-session-code"))
.status()
.expect("Failed to execute cargo build --release");

if !status.success() {
panic!("cargo build --release failed");
}

(true, get_default_wasm_directory(&project_root))
};
(true, get_default_wasm_directory(&project_root))
};

// Rerun the build script if the session binaries directory changes.
println!("cargo:rerun-if-changed={}", session_binaries_dir.display());
Expand Down

0 comments on commit 2eda67a

Please sign in to comment.