You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Previously there was copy method which assumed files inside sourceRoot. Now the method was removed (not documented anywhere), and using fs object is suggested (http://yeoman.io/authoring/file-system.html)
was working:
this.copy('path/to/file', 'path/to/file');
now failing, as there's no copy method now.
If change it to fs.copy:
this.fs.copy('path/to/file', 'path/to/file');
it's still failing, now inside mem-fs-editor\lib\actions\copy.js: AssertionError: Trying to copy from a source that does not exist: path/to/file
It turns out fs.copy ignores template path (sourceRoot).
So I have to add templatePath for the source file:
/**
* Change the generator source root directory.
* This path is used by multiples file system methods like (`this.read` and `this.copy`)
* @param {String} rootPath new source root path
* @return {String} source root path
*/
sourceRoot(rootPath)
The text was updated successfully, but these errors were encountered:
As continue #901
Previously there was
copy
method which assumed files insidesourceRoot
. Now the method was removed (not documented anywhere), and usingfs
object is suggested (http://yeoman.io/authoring/file-system.html)was working:
now failing, as there's no
copy
method now.If change it to
fs.copy
:it's still failing, now inside
mem-fs-editor\lib\actions\copy.js
: AssertionError: Trying to copy from a source that does not exist: path/to/fileIt turns out
fs.copy
ignores template path (sourceRoot
).So I have to add
templatePath
for the source file:very annoying as requires specifying
templatePath
forfs.copy
call.And it's also undocumented.
Also there are outdated and incorrect comment in code for
sourceRoot
- see https://github.com/yeoman/generator/blob/master/lib/index.js#L586The text was updated successfully, but these errors were encountered: