sagiegurari / shell2batch

Coverts simple basic shell scripts to windows batch scripts.
Apache License 2.0
57 stars 7 forks source link

cp -r on windows prompts for confirmation #13

Open AdamRzepka opened 4 years ago

AdamRzepka commented 4 years ago

cp -r dir_a dir_b translates to xcopy /e dir_a dir_b

If dir_b does not exist (which is probably the most common case), xcopy prompts:

Does include specify a file name
or directory name on the target
(F = file, D = directory)?

You can use /i switch to suppress this and always assume 'directory'.

Note that, creating a directory before copying doesn't help much. If destination dir already exist, behavior of cp and xcopy is different: xcopy copies only content of source directory, while cp copies also source directory itself.

sagiegurari commented 4 years ago

thanks... will check it out. by the way, if this is for cargo make, you might want to replace your shell script to duckscript which is consistent on all platforms.

AdamRzepka commented 4 years ago

Thank you! I'll take a look at duckscript.