mirror of
https://github.com/smogon/sprites.git
synced 2026-04-24 23:07:05 -05:00
deploy: debug() on exception
This commit is contained in:
parent
3119d5dcb8
commit
e98d42d0cf
|
|
@ -29,8 +29,13 @@ program
|
|||
const aq = new script.ActionQueue;
|
||||
|
||||
for (const src of files) {
|
||||
const dst = script.runOnFile(scr, src);
|
||||
aq.copy(src, dst);
|
||||
try {
|
||||
const dst = script.runOnFile(scr, src);
|
||||
aq.copy(src, dst);
|
||||
} catch(e) {
|
||||
// Move to script.runOnFile?
|
||||
aq.throw(e);
|
||||
}
|
||||
}
|
||||
|
||||
if (outputDir) {
|
||||
|
|
@ -51,8 +56,13 @@ program
|
|||
const aq = new script.ActionQueue;
|
||||
|
||||
for (const file of scripts) {
|
||||
const scr = new script.Script(file, 'file');
|
||||
script.run(scr, nodePath.dirname(file), aq);
|
||||
try {
|
||||
const scr = new script.Script(file, 'file');
|
||||
script.run(scr, nodePath.dirname(file), aq);
|
||||
} catch(e) {
|
||||
// Move to script.run?
|
||||
aq.throw(e);
|
||||
}
|
||||
}
|
||||
|
||||
if (outputDir) {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,11 @@ export class ActionQueue {
|
|||
this.valid = true;
|
||||
}
|
||||
|
||||
throw(obj : Error) {
|
||||
this.debug(obj);
|
||||
this.valid = false;
|
||||
}
|
||||
|
||||
debug(obj : unknown) {
|
||||
this.log.push({type: 'Debug', obj});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user