mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
Avoid exiting process
This commit is contained in:
parent
2c9f1d9be6
commit
2b7616918d
@ -107,7 +107,6 @@ const emitTypeScript = () => {
|
|||||||
|
|
||||||
if (child.status !== 0) {
|
if (child.status !== 0) {
|
||||||
console.error("Failed to execute tsc")
|
console.error("Failed to execute tsc")
|
||||||
process.exit(1)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +134,6 @@ const wasmPack = () => {
|
|||||||
|
|
||||||
// Having package.json within another npm package is not supported. Remove that.
|
// Having package.json within another npm package is not supported. Remove that.
|
||||||
unlink(`${getLibDirectory()}/src/wasm-pack/package.json`, (err) => {
|
unlink(`${getLibDirectory()}/src/wasm-pack/package.json`, (err) => {
|
||||||
if (err) throw err;
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,17 +147,22 @@ const watchResult = async (result) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const update = async (path) => {
|
const update = async (path) => {
|
||||||
console.log(`Updating: ${path}`)
|
try {
|
||||||
if (path.endsWith(".rs")) {
|
console.log(`Updating: ${path}`)
|
||||||
console.log("Rebuilding Rust...")
|
if (path.endsWith(".rs")) {
|
||||||
wasmPack();
|
console.log("Rebuilding Rust...")
|
||||||
|
wasmPack();
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("Rebuilding...")
|
||||||
|
await result.rebuild();
|
||||||
|
|
||||||
|
console.log("Emitting TypeScript types...")
|
||||||
|
emitTypeScript();
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Error while updating:")
|
||||||
|
console.error(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Rebuilding...")
|
|
||||||
await result.rebuild();
|
|
||||||
|
|
||||||
console.log("Emitting TypeScript types...")
|
|
||||||
emitTypeScript();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Watching...")
|
console.log("Watching...")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user