Can Yeoman generators update existing files?

前端 未结 5 1968
旧巷少年郎
旧巷少年郎 2021-01-30 10:57

So just to give you some context, I\'m trying to create a generator that will create some files (based on user input of course) as well as update some existing files in

5条回答
  •  执笔经年
    2021-01-30 11:33

    You can use the mem-fs-editor, and call the fs.append(filepath, contents, [options]) method.

    e.g.

    this.fs.append(this.contextRoot + "/index.html", "  

    Appended text

    ");

提交回复
热议问题