Skip to content

Commit

Permalink
set rwxrwxrwx because java copy doesn't copy permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
acrylic-style committed Jul 18, 2024
1 parent 8eed8cc commit 3109a40
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import net.blueberrymc.gradle.buildSrc.tasks.BaseBlueberryTask
import org.eclipse.jgit.api.Git
import org.gradle.api.Action
import java.io.File
import java.nio.file.Files
import java.nio.file.attribute.PosixFilePermissions
import java.text.SimpleDateFormat

open class PrepareMinecraftAction : Action<BaseBlueberryTask> {
Expand Down Expand Up @@ -36,6 +38,12 @@ open class PrepareMinecraftAction : Action<BaseBlueberryTask> {
from.copyRecursively(File(minecraftRoot, fileName), true)
} else {
from.copyTo(File(minecraftRoot, fileName), true)
if (fileName == "gradlew" && !System.getProperty("os.name").lowercase().contains("win")) {
Files.setPosixFilePermissions(
File(minecraftRoot, fileName).toPath(),
PosixFilePermissions.fromString("rwxrwxrwx")
)
}
}
}
val isWindows = System.getProperty("os.name").lowercase().contains("win")
Expand Down

0 comments on commit 3109a40

Please sign in to comment.