diff --git a/apps/cli/lib/archive.ts b/apps/cli/lib/archive.ts index a316478135..df0197f3b1 100644 --- a/apps/cli/lib/archive.ts +++ b/apps/cli/lib/archive.ts @@ -17,8 +17,9 @@ export async function archiveSiteContent( const output = fs.createWriteStream( archivePath ); const archiveBuilder = archiver( 'zip', { zlib: { level: ZIP_COMPRESSION_LEVEL }, + // @ts-expect-error The `followSymlinks` option comes from a patch followSymlinks: true, - } as archiver.ArchiverOptions ); + } ); output.on( 'close', () => { resolve( archiveBuilder ); diff --git a/apps/cli/lib/import-export/export/exporters/default-exporter.ts b/apps/cli/lib/import-export/export/exporters/default-exporter.ts index eb5601008e..7ffcf8bac8 100644 --- a/apps/cli/lib/import-export/export/exporters/default-exporter.ts +++ b/apps/cli/lib/import-export/export/exporters/default-exporter.ts @@ -153,7 +153,7 @@ export class DefaultExporter extends EventEmitter implements Exporter { this.emit( ExportEvents.BACKUP_CREATE_START ); const isZip = this.options.backupFile.endsWith( '.zip' ); const format = isZip ? 'zip' : 'tar'; - return archiver( format, ARCHIVER_OPTIONS[ format ] as archiver.ArchiverOptions ); + return archiver( format, ARCHIVER_OPTIONS[ format ] ); } private setupArchiveListeners( output: fs.WriteStream ): Promise< void > { diff --git a/apps/cli/patches/archiver+7.0.1.patch b/apps/cli/patches/archiver+7.0.1.patch new file mode 100644 index 0000000000..58b35f023c --- /dev/null +++ b/apps/cli/patches/archiver+7.0.1.patch @@ -0,0 +1,14 @@ +diff --git a/node_modules/archiver/lib/core.js b/node_modules/archiver/lib/core.js +index 7c0a74d..2934fe5 100644 +--- a/node_modules/archiver/lib/core.js ++++ b/node_modules/archiver/lib/core.js +@@ -631,7 +631,8 @@ + + var globOptions = { + stat: true, +- dot: true ++ dot: true, ++ follow: this.options.followSymlinks + }; + + function onGlobEnd() { diff --git a/apps/studio/patches/archiver+7.0.1.patch b/apps/studio/patches/archiver+7.0.1.patch new file mode 100644 index 0000000000..58b35f023c --- /dev/null +++ b/apps/studio/patches/archiver+7.0.1.patch @@ -0,0 +1,14 @@ +diff --git a/node_modules/archiver/lib/core.js b/node_modules/archiver/lib/core.js +index 7c0a74d..2934fe5 100644 +--- a/node_modules/archiver/lib/core.js ++++ b/node_modules/archiver/lib/core.js +@@ -631,7 +631,8 @@ + + var globOptions = { + stat: true, +- dot: true ++ dot: true, ++ follow: this.options.followSymlinks + }; + + function onGlobEnd() { diff --git a/apps/studio/src/lib/import-export/export/exporters/default-exporter.ts b/apps/studio/src/lib/import-export/export/exporters/default-exporter.ts index 6719280465..cbf3a09115 100644 --- a/apps/studio/src/lib/import-export/export/exporters/default-exporter.ts +++ b/apps/studio/src/lib/import-export/export/exporters/default-exporter.ts @@ -154,7 +154,7 @@ export class DefaultExporter extends EventEmitter implements Exporter { this.emit( ExportEvents.BACKUP_CREATE_START ); const isZip = this.options.backupFile.endsWith( '.zip' ); const format = isZip ? 'zip' : 'tar'; - return archiver( format, ARCHIVER_OPTIONS[ format ] as archiver.ArchiverOptions ); + return archiver( format, ARCHIVER_OPTIONS[ format ] ); } private setupArchiveListeners( output: fs.WriteStream ): Promise< void > {