2017-04-25 2 views
2

Wie kann ich Dateien ignorieren? Ich möchte alle Dateien ausschließen, die mit _ in irgendeinem Unterverzeichnis beginnen. Ich habe keinen Erfolg mit diesen beiden Ansätzen:Yeoman ignoriert Dateien mit fs.copyTpl

this.fs.copyTpl(
    this.templatePath('basicFiles/'), 
    this.destinationPath(''), 
    answers, 
    {ignore:"_*.*"} 
); 

this.fs.copyTpl(
    [!*.*,this.templatePath('basicFiles/')], 
    this.destinationPath(''), 
    answers 
); 

allgemeinen, jeden Grund möchte (tiefe Kopie)/_exmaple.json in additionalConfig/example.json zu desitnationPaht/exmaple.json (fusionieren) fusionieren.

Jede Idee ist willkommen :).

Antwort

0

Für fs.copyTpl Ihre {ignore:"_*.*"} Bedürfnisse im 5. Argument Objekt sein (wie die syntax sagt) und innerhalb globOptions Schlüssel:

this.fs.copyTpl(
    this.templatePath('**/*'), // from 
    this.destinationRoot(), // to 
    {}, // context   // not here 
    {}, // templateOptions // not here 
    { globOptions: {ignore:"_*.*"} } // < but here 
) 

Das Gleiche gilt für {dot: true} und andere Optionen.