-
-
Notifications
You must be signed in to change notification settings - Fork 70
Conversation
It seems likely to me that there's a way to solve #20 without introducing a new option. |
@jmeas perhaps just for fixing #20, however this PR addresses far more use-cases than just that outlined in issue #20 and I still believe it is a more versatile solution. I could have simply added the behavior I was describing, but then someone might have requested the ability to move even though a destination is specified. I do not believe that moving should be mutually exclusive to specifying destinations. |
needs tests |
@eddiemonge @ProLoser I've written some tests and doc, any feedback? Is this the right way of contributing to this, btw? |
tests and documentation for copy option
@mwillerich that works, thanks! I'm no longer working at the company that used these changes so getting tests became less relevant to my urgent needs lol. In the future, if I (the middle-man) appear to be no longer active you can always fork off of my work and open a new pull request directly into the yeoman fork and just bypass my own. @eddiemonge I merged @mwillerich's tests |
dirname = el.dest ? el.dest : path.dirname(file); | ||
resultPath = path.resolve(dirname, newName); | ||
|
||
if (options.copy === null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this should be if (!options.copy) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a 3-state option. True, False and null. Perhaps the check should be rearranged so that it explicitly does options.copy === true
, options.copy === false
and then just use this case for the rest. Since null != undefined
I'm honestly no longer working or using this code whatsoever so you guys are better off using @mwillerich's fork. |
I have opened new PR #31 from my fork. |
If undefined (
null
) then the old behavior takes precedence regarding destination deciding if the files are copied or moved.However, you can now override this behavior in either direction.
options.copy = true
will always copy, regardless of if destination is defined or notoptions.copy = false
will always move, regardless of if destination is defined or not