File tree Expand file tree Collapse file tree
packages/amplify-cli-core/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ const path = require('path');
99const { promisify } = require ( 'util' ) ;
1010const stream = require ( 'stream' ) ;
1111const yauzl = require ( 'yauzl' ) ;
12+ const { getAmplifyLogger } = require ( '@aws-amplify/amplify-cli-logger' ) ;
1213
1314const openZip = promisify ( yauzl . open ) ;
1415const pipeline = promisify ( stream . pipeline ) ;
@@ -113,11 +114,12 @@ class Extractor {
113114 await fs . mkdir ( destDir , mkdirOptions ) ;
114115 if ( isDir ) return ;
115116
116- const readStream = await promisify ( this . zipfile . openReadStream . bind ( this . zipfile ) ) ( entry ) ;
117-
118- if ( ! symlink ) {
119- await pipeline ( readStream , createWriteStream ( dest , { mode : procMode } ) ) ;
117+ if ( symlink ) {
118+ getAmplifyLogger ( ) . logError ( { message : 'Found symlinks in the zipped directory. These symlinks will not be extracted' } ) ;
119+ return ;
120120 }
121+ const readStream = await promisify ( this . zipfile . openReadStream . bind ( this . zipfile ) ) ( entry ) ;
122+ await pipeline ( readStream , createWriteStream ( dest , { mode : procMode } ) ) ;
121123 }
122124
123125 getExtractedMode ( entryMode , isDir ) {
You can’t perform that action at this time.
0 commit comments