chore(deploy): remove _debug.txt on success; gitignore build output

This commit is contained in:
chenxing
2026-08-04 23:32:29 +08:00
parent 68d9e3520a
commit 3a3b0e7e79
+9 -1
View File
@@ -247,13 +247,21 @@ async function main() {
main()
.then(async () => {
// On success, keep diagnostics only briefly, then remove the debug file so
// it is not left web-served at /userbase/_debug.txt. Failures keep it for
// post-mortem (see .catch below).
await flushDebug();
try {
if (HELPER_ID) await runExec(HELPER_ID, `rm -f ${HOST_STATIC}/_debug.txt`);
} catch (e) {
console.error('cleanup debug file failed:', e.message);
}
if (HELPER_ID) await dockerJson('DELETE', `/containers/${HELPER_ID}?force=true`);
process.exit(0);
})
.catch(async (err) => {
dbg('DEPLOY FAILED: ' + err.stack);
await flushDebug();
await flushDebug(); // keep debug file on failure for post-mortem
if (HELPER_ID) await dockerJson('DELETE', `/containers/${HELPER_ID}?force=true`);
console.error('DEPLOY FAILED:', err.message);
process.exit(1);