diff options
author | Sam Wilkins <samwilkins333@gmail.com> | 2020-01-12 02:33:40 -0500 |
---|---|---|
committer | Sam Wilkins <samwilkins333@gmail.com> | 2020-01-12 02:33:40 -0500 |
commit | e6995511a36d5ced79e0738f06487bec592cb992 (patch) | |
tree | a36e81e8bee79d73feaa5bc992e77367584025ec | |
parent | 03a5af39e1b9d710b2882669a027cfc5ca98ed9f (diff) |
remove backup for debug
-rw-r--r-- | src/server/DashSession/DashSessionAgent.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/server/DashSession/DashSessionAgent.ts b/src/server/DashSession/DashSessionAgent.ts index 8aa84f1dd..bf07cf89e 100644 --- a/src/server/DashSession/DashSessionAgent.ts +++ b/src/server/DashSession/DashSessionAgent.ts @@ -9,6 +9,7 @@ import { readdirSync, statSync, createWriteStream, readFileSync, unlinkSync } fr import * as Archiver from "archiver"; import { resolve } from "path"; import { AppliedSessionAgent, MessageHandler, ExitHandler, Monitor, ServerWorker } from "resilient-server-session"; +import rimraf = require("rimraf"); /** * If we're the monitor (master) thread, we should launch the monitor logic for the session. @@ -184,10 +185,11 @@ export class DashSessionAgent extends AppliedSessionAgent { // create a zip file and to it, write the contents of the backup directory const zipName = `${target}.zip`; const zipPath = `${this.releaseDesktop}/${zipName}`; + const targetPath = `${backupsDirectory}/${target}`; const output = createWriteStream(zipPath); const zip = Archiver('zip'); zip.pipe(output); - zip.directory(`${backupsDirectory}/${target}/Dash`, false); + zip.directory(`${targetPath}/Dash`, false); await zip.finalize(); mainLog(`zip finalized with size ${statSync(zipPath).size} bytes, saved to ${zipPath}`); @@ -200,6 +202,7 @@ export class DashSessionAgent extends AppliedSessionAgent { }); unlinkSync(zipPath); + rimraf.sync(targetPath); // indicate success or failure mainLog(`${error === null ? green("successfully dispatched") : red("failed to dispatch")} ${zipName} to ${cyan(to)}`); |