mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-08 12:07:52 -06:00
chore: setup --debug/--release args for web build script & recipe, fix test lint
This commit is contained in:
5
Justfile
5
Justfile
@@ -40,5 +40,6 @@ samply:
|
|||||||
samply record ./target/profile/pacman{{ binary_extension }}
|
samply record ./target/profile/pacman{{ binary_extension }}
|
||||||
|
|
||||||
# Build the project for Emscripten
|
# Build the project for Emscripten
|
||||||
web:
|
web *args:
|
||||||
bun run web.build.ts; caddy file-server --root dist
|
bun run web.build.ts {{args}};
|
||||||
|
caddy file-server --root dist
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ fn test_atlas_mapper_multiple_frames() {
|
|||||||
assert!(mapper.frames.contains_key("tile1"));
|
assert!(mapper.frames.contains_key("tile1"));
|
||||||
assert!(mapper.frames.contains_key("tile2"));
|
assert!(mapper.frames.contains_key("tile2"));
|
||||||
assert!(!mapper.frames.contains_key("tile3"));
|
assert!(!mapper.frames.contains_key("tile3"));
|
||||||
assert!(mapper.frames.get("nonexistent").is_none());
|
assert!(!mapper.frames.contains_key("nonexistent"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
15
web.build.ts
15
web.build.ts
@@ -501,7 +501,6 @@ async function activateEmsdk(
|
|||||||
|
|
||||||
return { vars };
|
return { vars };
|
||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
// Print the OS detected
|
// Print the OS detected
|
||||||
logger.debug(
|
logger.debug(
|
||||||
@@ -515,7 +514,19 @@ async function main() {
|
|||||||
.exhaustive()
|
.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");
|
const emsdkDir = resolve("./emsdk");
|
||||||
|
|
||||||
// Activate the Emscripten SDK (returns null if already activated)
|
// Activate the Emscripten SDK (returns null if already activated)
|
||||||
|
|||||||
Reference in New Issue
Block a user