deploy: debug() on exception

This commit is contained in:
Christopher Monsanto 2020-08-22 22:37:52 -04:00
parent 3119d5dcb8
commit e98d42d0cf
2 changed files with 19 additions and 4 deletions

View File

@ -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) {

View File

@ -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});
}