boot-clj / boot

Build tooling for Clojure.
https://boot-clj.github.io/
Eclipse Public License 1.0
1.75k stars 182 forks source link

Add --mode option to built in target task #537

Closed ekroon closed 7 years ago

ekroon commented 7 years ago

For situations where the default 'rw-------' file modes are not enough, a (posix) mode string can be given to target. All files will get the mode written.

When an invalid mode is given, a warning is printed and standard permissions will be used.

alandipert commented 7 years ago

Has anyone tried this on Windows?

ekroon commented 7 years ago

Good point, I implemented it this way, because tmp files already are created with PosixFilePermissions. Maybe I missed a Windows check somewhere as there is a good chance this doesn't work on Windows indeed. I did not check, so I will check it and adapt if necessary.

alandipert commented 7 years ago

@ekroon cool, thank you. I haven't checked myself, so it may very well work. I just wanted to make sure someone has tried it.

ekroon commented 7 years ago

In https://github.com/asciidoctor/atom-language-asciidoc they use www.appveyor.com for Windows testing. Would that be an option for boot?

alandipert commented 7 years ago

Can you please add arities to link! and copy! that don't take mode, but call the arity that does with a value of nil for mode?

Then the arity change is backward compatible. Thanks :metal:

alandipert commented 7 years ago

It looks like the earlier PosixFilePermissionsrelated code did break Boot on windows, so presumably this would too: https://github.com/boot-clj/boot/issues/541

alandipert commented 7 years ago

@ekroon I don't have experience with appveyor but am certainly open to it.

ekroon commented 7 years ago

@alandipert took the liberty to also fix #541 on this branch as it is closely related.