Set posix +x

Co-Authored-By: Eric Peters <eric@peters.org>
This commit is contained in:
Josh Soref 2019-09-24 12:31:18 -04:00 committed by GitHub
parent 07814bc576
commit f06e7e638e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -176,10 +176,18 @@ val root = (project in file(".")).
val BinBat = BinSbt + ".bat"
prev.toList map {
case (k, BinSbt) =>
import java.nio.file.{Files, FileSystems}
val x = IO.read(k)
IO.write(t / "sbt", x.replaceAllLiterally(
"declare init_sbt_version=_to_be_replaced",
s"""declare init_sbt_version=$sbtVersionToRelease"""))
if (FileSystems.getDefault.supportedFileAttributeViews.contains("posix")) {
val perms = Files.getPosixFilePermissions(k.toPath)
Files.setPosixFilePermissions(t / "sbt" toPath, perms)
}
(t / "sbt", BinSbt)
case (k, BinBat) =>
val x = IO.read(k)