2016-03-22 23 views
0

Bir şablondan Yeoman ile bir proje oluşturmaya çalışıyorum. Tüm dosyaları portanova şablon klasöründen kopyalayabilirim ancak başka bir şablon klasöründen bir dosya kopyalayıp projeme ekleyemiyorum. Bana "bir dizinde yasadışı işlem" istisnası veriyor. Neyi yanlış yapıyorum?yeoman ile proje oluşturma

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') 
    ); 
    } 
    }, 

cevap

0

Kontrol bunu denemek değilse, 2. klasörden kopyalamak hakkına sahip Hava:

chmod -R 777 /Your/folder 

Ps (-R: Bir klasöre üzerinde çalışmak için)

İlgili konular