Commit cf5b1912 authored by Christian Meyer's avatar Christian Meyer
Browse files

ZmtShortcutPlugin.groovy: fixed setting permission if file system does not support it

parent 902fd7ff
package de.zmt.gradle;
import org.gradle.api.*
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.*
import java.nio.file.attribute.PosixFilePermissions
/**
......@@ -24,8 +23,10 @@ public class ZmtShortcutPlugin implements Plugin<Project> {
def shortcutDir = Files.createTempDirectory('shortcuts')
afterEvaluate {
def unixShortcut = createLauncherShortcut(project, SHORTCUT_UNIX, shortcutDir)
// set +x permissions for unix shortcut
Files.setPosixFilePermissions(unixShortcut, PosixFilePermissions.fromString('rwxr-xr-x'))
// set +x permissions if possible
if (FileSystems.getDefault().supportedFileAttributeViews().contains("posix")) {
Files.setPosixFilePermissions(unixShortcut, PosixFilePermissions.fromString('rwxr-xr-x'))
}
createLauncherShortcut(project, SHORTCUT_WIN, shortcutDir)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment