lib/plugins/create/create.js/Create/create
class Create:  create() {
    this.serverless.cli.log('Generating boilerplate...');

    if ('template' in this.options) {
      this.createFromTemplate();
    } else if ('template-url' in this.options) {
      return download.downloadTemplateFromRepo(
        this.options['template-url'],
        this.options.name,
        this.options.path
      )
        .then(dirName => {
          const message = [
            `Successfully installed "${dirName}" `,
            `${this.options.name && this.options.name !== dirName ? `as "${dirName}"` : ''}`,
          ].join('');

          this.serverless.cli.log(message);

          userStats.track('service_created', {
            template: this.options.template,
            serviceName: this.options.name,
          });
        })
        .catch(err => {
          throw new this.serverless.classes.Error(err);
        });
    } else if ('template-path' in this.options) {
      // Copying template from a local directory
      const servicePath = this.options.path || path.join(process.cwd(), this.options.name);
      if (dirExistsSync(servicePath)) {
        const errorMessage = `A folder named "${servicePath}" already exists.`;
        throw new ServerlessError(errorMessage);
      }
      copyDirContentsSync(this.options['template-path'], servicePath, {
        noLinks: true,
      });
      if (this.options.name) {
        renameService(this.options.name, servicePath);
      }
    } else {
      const errorMessage = [
        'You must either pass a template name (--template), ',
        'a URL (--template-url) or a local path (--template-path).',
      ].join('');
      throw new this.serverless.classes.Error(errorMessage);
    }
    return BbPromise.resolve();
  }