Open dy opened 5 years ago
Wait, but you said .env
is a file, then why is it put as a destination, ./.env
, the second argument above?
To me it looks like you're putting two source files and incorrectly assuming second will be a destination.
If you really had two dot files, you could use globs. For example, if both files are in current directory, then try:
npx cpy ".*" "c:\projects\secret_folder"
or do one-by-one...
Please update how it went. And please correct me if I misunderstood the question. Cheers
@revelt I just expected the way cp
works, so I used shx for that:
shx cp ./.env.development ./.env
Not sure what trouple cpy
makes of files named .env.sfx
I see... Do you think we can solve this or are you happy with shx
? I'm a user of this cli myself and one-to-one file copying works fine. But API can always be improved, it's just we have to draw up a persuasive case first. What do you think @dy ?
That seems to be an issue of related cpy
and other packages. Needs resolution.
I'd rather set a tip to @sindresorhus for fixing that case, that'd be faster.
So far I'm fine with shx
Yeah, that's a bug in cpy
. It should allow the the destination to be a file if the source is just one file and the destination doesn't already exist as a directory.
Hello Is there any news about this issue ?
We have
.env
and.env.development
files in theC:\projects\xxx\
. Running cpy gives:Is that the expected result? Is there a workaround? @sindresorhus