Создание проекта с Йоманом

Я пытаюсь создать проект с Yeoman из шаблона. Я могу скопировать все файлы из папки шаблонов portanova, но я не могу скопировать файл из другой папки шаблонов и добавить его в свой проект. Это дает мне исключение "недопустимая операция с каталогом". Что я делаю не так?

 this.log(yosay(
      'Welcome to the fantabulous ' + chalk.red('') + ' generator!'
    ));

    var prompts = [{
      name: 'projectName',
      message: 'What do you want to call the new project ?'
    },{
      name: 'answer',
      message: 'would you like to add File X ?'
    }

    ];

    this.prompt(prompts, function (props) {
      this.projectName = props.projectName;
      this.answer = props.answer;
      done();
    }.bind(this));
  },

  writing: function () {

    this.fs.copy(
      this.templatePath('portanova_template'),
      this.destinationPath(this.projectName)
    );
    if(this.answer=='yes'){
      this.fs.copy(
        this.templatePath('externalTemplate/fileX.html'),
        this.destinationPath(this.projectName+'/app')
      );
    }
  },

1 ответ

Проверьте, есть ли у вас право копировать из 2-й папки, если нет, попробуйте это:

chmod -R 777 /Your/folder

Ps (-R: работать с папкой)

Другие вопросы по тегам