@forge/cli-shared
9.4.1-next.3-experimental-e9e08bb9.4.1-next.4
out/file-system/archiver.js~
out/file-system/archiver.jsModified+8−6
Index: package/out/file-system/archiver.js
===================================================================
--- package/out/file-system/archiver.js
+++ package/out/file-system/archiver.js
@@ -93,17 +93,19 @@
}
exports.ZipArchiver = ZipArchiver;
class DirectoryArchiver extends Archiver {
target;
- constructor(target) {
+ constructor(target, clear = true) {
super();
this.target = target;
- try {
- (0, fs_1.rmSync)(this.target, { recursive: true, force: true });
+ if (clear) {
+ try {
+ (0, fs_1.rmSync)(this.target, { recursive: true, force: true });
+ }
+ catch (e) {
+ throw new ArchiverError(e.message);
+ }
}
- catch (e) {
- throw new ArchiverError(e.message);
- }
}
addContent(fileName, contents) {
validateArchivePath(fileName);
try {