forked from MapComplete/MapComplete
Scripts: add debug code
This commit is contained in:
parent
01c191e6aa
commit
d39e034201
1 changed files with 9 additions and 1 deletions
|
@ -21,10 +21,18 @@ class GeneratePmTilesExtracts extends Script {
|
||||||
startProcess(script: string): Promise<void> {
|
startProcess(script: string): Promise<void> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const child = spawn("/data/pmtiles", script.split(" "), {
|
const child = spawn("/data/pmtiles", script.split(" "), {
|
||||||
stdio: "ignore",
|
stdio: ['pipe', 'pipe', 'pipe'],
|
||||||
cwd: this.targetDir,
|
cwd: this.targetDir,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
child.stdout.on('data', data => {
|
||||||
|
console.log(`stdout: ${data}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
child.stderr.on('data', data => {
|
||||||
|
console.error(`stderr: ${data}`);
|
||||||
|
});
|
||||||
|
|
||||||
child.on("close", (code) => {
|
child.on("close", (code) => {
|
||||||
if (code === 0) resolve()
|
if (code === 0) resolve()
|
||||||
else reject(new Error(`Process exited with code ${code}`))
|
else reject(new Error(`Process exited with code ${code}`))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue