lib/zip.js
function addVendorHelper() {
  if (this.options.zip) {
    if (this.serverless.service.package.individually) {
      return BbPromise.resolve(this.targetFuncs)
        .map(f => {
          if (!get(f, 'package.include')) {
            set(f, ['package', 'include'], []);
          }
          if (!get(f, 'module')) {
            set(f, ['module'], '.');
          }
          f.package.include.push('unzip_requirements.py');
          return f;
        })
        .then(functions => uniqBy(functions, func => func.module))
        .map(f => {
          this.serverless.cli.log(
            `Adding Python requirements helper to ${f.module}...`
          );

          return fse.copyAsync(
            path.resolve(__dirname, '../unzip_requirements.py'),
            path.join(this.servicePath, f.module, 'unzip_requirements.py')
          );
        });
    } else {
      this.serverless.cli.log('Adding Python requirements helper...');

      if (!get(this.serverless.service, 'package.include')) {
        set(this.serverless.service, ['package', 'include'], []);
      }

      this.serverless.service.package.include.push('unzip_requirements.py');

      return fse.copyAsync(
        path.resolve(__dirname, '../unzip_requirements.py'),
        path.join(this.servicePath, 'unzip_requirements.py')
      );
    }
  }
}
function addVendorHelper() {
  if (this.options.zip) {
    if (this.serverless.service.package.individually) {
      return BbPromise.resolve(this.targetFuncs)
        .map(f => {
          if (!get(f, 'package.include')) {
            set(f, ['package', 'include'], []);
          }
          if (!get(f, 'module')) {
            set(f, ['module'], '.');
          }
          f.package.include.push('unzip_requirements.py');
          return f;
        })
        .then(functions => uniqBy(functions, func => func.module))
        .map(f => {
          this.serverless.cli.log(
            `Adding Python requirements helper to ${f.module}...`
          );

          return fse.copyAsync(
            path.resolve(__dirname, '../unzip_requirements.py'),
            path.join(this.servicePath, f.module, 'unzip_requirements.py')
          );
        });
    } else {
      this.serverless.cli.log('Adding Python requirements helper...');

      if (!get(this.serverless.service, 'package.include')) {
        set(this.serverless.service, ['package', 'include'], []);
      }

      this.serverless.service.package.include.push('unzip_requirements.py');

      return fse.copyAsync(
        path.resolve(__dirname, '../unzip_requirements.py'),
        path.join(this.servicePath, 'unzip_requirements.py')
      );
    }
  }
}
function addVendorHelper ( ) { if ( this . options . zip ) { if ( this . serverless . service . package . individually ) { return BbPromise . resolve ( this . targetFuncs ) . map ( f => { if ( ! get ( f , 'package.include' ) ) { set ( f , [ 'package' , 'include' ] , [ ] ) ; } if ( ! get ( f , 'module' ) ) { set ( f , [ 'module' ] , '.' ) ; } f . package . include . push ( 'unzip_requirements.py' ) ; return f ; } ) . then ( functions => uniqBy ( functions , func => func . module ) ) . map ( f => { this . serverless . cli . log ( ` ${ f . module } ` ) ; return fse . copyAsync ( path . resolve ( __dirname , '../unzip_requirements.py' ) , path . join ( this . servicePath , f . module , 'unzip_requirements.py' ) ) ; } ) ; } else { this . serverless . cli . log ( 'Adding Python requirements helper...' ) ; if ( ! get ( this . serverless . service , 'package.include' ) ) { set ( this . serverless . service , [ 'package' , 'include' ] , [ ] ) ; } this . serverless . service . package . include . push ( 'unzip_requirements.py' ) ; return fse . copyAsync ( path . resolve ( __dirname , '../unzip_requirements.py' ) , path . join ( this . servicePath , 'unzip_requirements.py' ) ) ; } } }
Add the vendor helper to the current service tree.
@return {Promise}
Add the vendor helper to the current service tree .