How do I specify permissions for sbt artefacts

Viewed 97

How does one specify the permissions for files output by sbt? I need these to be set correctly in order to be able to test the code with my local Apache server.

In the scalaJS project after a clean fastOptJS I can see that the launcherapp-fastopt.js files are user read only.

$ ls -al target/scala-2.13/
total 240
drwxr-xr-x  6 hjs  staff    192 23 Oct 11:08 .
drwxr-xr-x  5 hjs  staff    160 23 Oct 11:08 ..
drwxr-xr-x  6 hjs  staff    192 23 Oct 11:08 classes
-rw-------  1 hjs  staff  69861 23 Oct 11:08 launcherapp-fastopt.js
-rw-------  1 hjs  staff  48380 23 Oct 11:08 launcherapp-fastopt.js.map
drwxr-xr-x  3 hjs  staff     96 23 Oct 11:08 update

Apache won't see it with those permissions so I have to change the mode on the files like this:

$ chmod -R a+rX target/
$ ls -al target/scala-2.13/
total 240
drwxr-xr-x  6 hjs  staff    192 23 Oct 11:08 .
drwxr-xr-x  5 hjs  staff    160 23 Oct 11:08 ..
drwxr-xr-x  6 hjs  staff    192 23 Oct 11:08 classes
-rw-r--r--  1 hjs  staff  69861 23 Oct 11:08 launcherapp-fastopt.js
-rw-r--r--  1 hjs  staff  48380 23 Oct 11:08 launcherapp-fastopt.js.map
drwxr-xr-x  3 hjs  staff     96 23 Oct 11:08 update

Is there a way to specify the rights in sbt for the produced artefacts so I don't have to chmod everytime I compile?

For a use case see the Launcher App

0 Answers
Related