From 3a3b0e7e79539bdeb2f261fedefebfa326b5210e Mon Sep 17 00:00:00 2001 From: chenxing Date: Tue, 4 Aug 2026 23:32:29 +0800 Subject: [PATCH] chore(deploy): remove _debug.txt on success; gitignore build output --- scripts/deploy-via-docker.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/deploy-via-docker.js b/scripts/deploy-via-docker.js index ab3fd1b..af308de 100644 --- a/scripts/deploy-via-docker.js +++ b/scripts/deploy-via-docker.js @@ -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);