fix watch mode not working when initial compile fails

This commit is contained in:
2022-03-05 21:18:55 +01:00
parent a6a82ff5a1
commit 99a423619e
6 changed files with 69 additions and 55 deletions

2
platform/Cargo.lock generated
View File

@@ -146,7 +146,7 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
[[package]]
name = "curlywas"
version = "0.1.0"
source = "git+https://github.com/exoticorn/curlywas.git?rev=89638565#896385654ab2c089200920b6dea4abec641c88d6"
source = "git+https://github.com/exoticorn/curlywas.git?rev=557c3a84#557c3a842675a1ebd77e84021f9f5236d4fa5648"
dependencies = [
"anyhow",
"ariadne",

View File

@@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
curlywas = { git="https://github.com/exoticorn/curlywas.git", rev="89638565" }
curlywas = { git="https://github.com/exoticorn/curlywas.git", rev="557c3a84" }
uw8-tool = { path="../uw8-tool" }
anyhow = "1"
lodepng = "3.4"

View File

@@ -11,16 +11,16 @@ fn main() -> Result<()> {
convert_font()?;
println!("Compiling loader module");
let loader = curlywas::compile_file("src/loader.cwa", curlywas::Options::default())?;
File::create("bin/loader.wasm")?.write_all(&loader.wasm)?;
let loader = curlywas::compile_file("src/loader.cwa", curlywas::Options::default()).0?;
File::create("bin/loader.wasm")?.write_all(&loader)?;
println!("Loader (including base module): {} bytes", loader.wasm.len());
println!("Loader (including base module): {} bytes", loader.len());
println!("Compiling platform module");
let platform = curlywas::compile_file("src/platform.cwa", curlywas::Options::default())?;
let platform = curlywas::compile_file("src/platform.cwa", curlywas::Options::default()).0?;
println!("Compressing platform module");
let platform = uw8_tool::pack(
&platform.wasm,
&platform,
&uw8_tool::PackConfig::default().with_compression_level(4),
)?;
File::create("bin/platform.uw8")?.write_all(&platform)?;