When you use clojure.tools.build.api/copy-dir
with :replace
it reads the source file and then writes a new target file -- it doesn't "copy" the file so the target file is created with default permissions.
This is a problem if you are copying executable shell scripts and trying to replace text in them because the target file created won't have executable permissions.
This cropped up with deps-new
in this issue: https://github.com/seancorfield/deps-new/issues/22
I think that if you source file is executable, the target file should also be executable -- and that works fine without :replace
.