Open ZebraFlesh opened 2 years ago
Does it work if you remove !**/*.stories.scss
?
// @andy2mrqz
Does it work if you remove
!**/*.stories.scss
?
Strangely no: it encounters an error trying to copy a file from the node_modules
directory, which is a sibling to src
. So it seems like the --cwd=src
flag is not being honored. (If the flag was honored, cpy-cli
wouldn't even traverse into the node_modules
directory.)
I face the same issue. 4.x is not working for me anymore. Had to rollback to 3.x
@sindresorhus thanks for tagging, I totally missed the notifications and didn't see this until now.
I inspected #34 to see if that could have introduced a regression. The areas that my PR touched were:
I think the regression may have been introduced in cpy v9, which this package proxies to, in sindresorhus/cpy#92. The most recent comment as of writing mentions an issue very similar to this one.
I also was able to recreate this issue by creating a simple repo with cpy
and the file structure that ZebraFresh mentioned in his description. This seems to indicate that cpy-cli is not the failure point.
Sometime in the coming days/weeks I'll spend some time and see if I can resolve the issue in cpy - but the main blockers there are time and my lack of familiarity with cpy internals. Anyone else interested should feel free to jump in and contribute as well, if able.
Hi there,
The current behavior i see is, that glob patterns must start with a posix path segment:
**/*
will not work.
Possible fix could be
Just managed to fix this in my setup and i saw actually 1 issue and 1 breaking change:
--cwd
anymore but instead relative to actual current cwd.Not sure if it is related or if I should open another ticket, but with 5.0.0 --cwd
isn't working for us anymore the way it does in 4.x, so we had to switch back to 4.x.
with 5.0.0 don't work '--cwd'
@sindresorhus would be nice to have some feedback on this. I have been stuck on 3.x because of this. Hope you can look at it
As I can see, the cwd
-argument is handled twice.
First to create the relative path for each item that should be copied, then processed once again by copyFile.
If removed from options
when passed to copyFile
it works (at least for me).
The example with --cwd
should have been:
# with this project tree:
# .
# └── src
# ├── a.file
# └── subdirectory
# └── another.file
cpy . '../../dist' --cwd=src
# should produce:
# .
# ├── dist
# │ ├── a.file
# │ └── subdirectory
# │ └── another.file
# └── src
# ├── a.file
# └── subdirectory
# └── another.file
Let's say you want to copy the contents from src/subdirectory
to dist
, the relative path to the destination-directory needs to be referenced twice.
# this would be the expected destination path, if the initial example was correct
cpy . '../../dist' --cwd=src/subdirectory
# ... but, in order to get it to work, you need to add the relative path _TWICE_.
cpy . '../../../../dist' --cwd=src/subdirectory
Previously I was executing the following command with 3.1.x
with a result similar to:
However, the 4.0 release doesn't find any files to copy. This seems like a globbing problem.