From 8303fb16eabfa6d1a7afd9e96a563a4ca5d864e8 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Thu, 31 Mar 2016 19:04:54 +0100 Subject: [PATCH] archive error handling --- ts/export/packer/packer.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ts/export/packer/packer.ts b/ts/export/packer/packer.ts index c5229af86e..a2675b57d6 100644 --- a/ts/export/packer/packer.ts +++ b/ts/export/packer/packer.ts @@ -6,6 +6,10 @@ export class Packer { constructor() { this.archive = archiver.create("zip", {}); + + this.archive.on('error', (err) => { + throw err; + }); } pack(output: fs.WriteStream): void { @@ -18,5 +22,9 @@ export class Packer { src: ['**', '**/.rels'] } ]); + + //this.archive.directory(__dirname + "/template", "/"); + + this.archive.finalize(); } } \ No newline at end of file