build/src/index.js
/**
     * Package all of the sources into a zip file.
     * @private
     */
Package all of the sources into a zip file.
@private
Package all of the sources into a zip file . @private
async _pack() {
        return new Promise(async (resolve, reject) => {
            const zipPath = path.join(os.tmpdir(), uuid.v4()) + '.zip';
            const output = fs.createWriteStream(zipPath);
            const archive = archiver('zip');
            output.on('close', () => resolve(zipPath));
            archive.on('error', reject);
            archive.pipe(output);
            const ignorePatterns = await this._getIgnoreRules();
            const files = await globby('**/**', {
                ignore: ignorePatterns,
                cwd: this._options.targetDir,
            });
            files.forEach(f => {
                const fullPath = path.join(this._options.targetDir, f);
                archive.append(fs.createReadStream(fullPath), { name: f });
            });
            archive.finalize();
        });
    }
async _pack ( ) { return new Promise ( async ( resolve , reject ) => { const zipPath = path . join ( os . tmpdir ( ) , uuid . v4 ( ) ) + '.zip' ; const output = fs . createWriteStream ( zipPath ) ; const archive = archiver ( 'zip' ) ; output . on ( 'close' , ( ) => resolve ( zipPath ) ) ; archive . on ( 'error' , reject ) ; archive . pipe ( output ) ; const ignorePatterns = await this . _getIgnoreRules ( ) ; const files = await globby ( '**/**' , { ignore : ignorePatterns , cwd : this . _options . targetDir , } ) ; files . forEach ( f => { const fullPath = path . join ( this . _options . targetDir , f ) ; archive . append ( fs . createReadStream ( fullPath ) , { name : f } ) ; } ) ; archive . finalize ( ) ; } ) ; }
Package all of the sources into a zip file.
Package all of the sources into a zip file .
// eslint-disable-next-line no-async-promise-executor