Skip to content

Commit

Permalink
build: hotfix building no api case
Browse files Browse the repository at this point in the history
  • Loading branch information
nick1udwig committed Jul 10, 2024
1 parent 10694d5 commit 9f17645
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kit"
version = "0.6.4"
version = "0.6.5"
edition = "2021"

[build-dependencies]
Expand Down
14 changes: 10 additions & 4 deletions src/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,11 @@ async fn compile_package(

// create a target/api/ dir: this will be zipped & published in pkg/
// In addition, exporters, below, will be placed here to complete the API
copy_dir(package_dir.join("api"), package_dir.join("target").join("api"))?;
let api_dir = package_dir.join("api");
let target_api_dir = package_dir.join("target").join("api");
if api_dir.exists() {
copy_dir(&api_dir, &target_api_dir)?;
}

// find non-standard imports/exports -> compositions
let (importers, exporters) = find_non_standard(package_dir, wasm_paths)?;
Expand Down Expand Up @@ -858,9 +862,11 @@ async fn compile_package(
}

// zip & place API inside of pkg/ to publish API
let zip_path = package_dir.join("pkg").join("api.zip");
let zip_path = zip_path.to_str().unwrap();
zip_directory(&package_dir.join("target").join("api"), zip_path)?;
if target_api_dir.exists() {
let zip_path = package_dir.join("pkg").join("api.zip");
let zip_path = zip_path.to_str().unwrap();
zip_directory(&target_api_dir, zip_path)?;
}

Ok(())
}
Expand Down

0 comments on commit 9f17645

Please sign in to comment.