chore: setup --debug/--release args for web build script & recipe, fix test lint

This commit is contained in:
Ryan Walters
2025-09-04 14:47:22 -05:00
parent 968eb39b64
commit 9e029966dc
3 changed files with 17 additions and 5 deletions

View File

@@ -40,5 +40,6 @@ samply:
samply record ./target/profile/pacman{{ binary_extension }}
# Build the project for Emscripten
web:
bun run web.build.ts; caddy file-server --root dist
web *args:
bun run web.build.ts {{args}};
caddy file-server --root dist

View File

@@ -50,7 +50,7 @@ fn test_atlas_mapper_multiple_frames() {
assert!(mapper.frames.contains_key("tile1"));
assert!(mapper.frames.contains_key("tile2"));
assert!(!mapper.frames.contains_key("tile3"));
assert!(mapper.frames.get("nonexistent").is_none());
assert!(!mapper.frames.contains_key("nonexistent"));
}
#[test]

View File

@@ -501,7 +501,6 @@ async function activateEmsdk(
return { vars };
}
async function main() {
// Print the OS detected
logger.debug(
@@ -515,7 +514,19 @@ async function main() {
.exhaustive()
);
const release = process.env.RELEASE !== "0";
// Parse command line args for build mode
const args = process.argv.slice(2);
let release = true; // Default to release mode
for (let i = 0; i < args.length; i++) {
const arg = args[i];
if (arg === "-d" || arg === "--debug") {
release = false;
} else if (arg === "-r" || arg === "--release") {
release = true;
}
}
const emsdkDir = resolve("./emsdk");
// Activate the Emscripten SDK (returns null if already activated)