In this samples, I couldn't find any samples regarding file permission when using Copy or working with files related
My kotlin gradle custom code here:
val deletePreviousGitHOok by tasks.registering(Delete::class) {
group = "utils"
description = "Deleting previous githook"
val preCommit = "${rootProject.rootDir}/.git/hooks/pre-commit"
val prePush = "${rootProject.rootDir}/.git/hooks/pre-push"
if (file(preCommit).exists() && file(prePush).exists()) {
delete(preCommit, prePush)
}
}
val installGitHook by tasks.registering(Copy::class) {
group = "utils"
description = "Adding githook to local working copy, this must be run manually"
dependsOn(deletePreviousGitHOok)
from("${rootProject.rootDir}/pre-commit", "${rootProject.rootDir}/pre-push")
into("${rootProject.rootDir}/.git/hooks")
fileMode = 777
}
Expected Behavior
file permission set correctly to 777
Current Behavior
line fileMode = 777 doesn't set the permission correctly, see image below:
The git console:
Context
Is there any alternative or samples to modify file permission when working with files with kotlin gradle?
Steps to Reproduce (for bugs)
Your Environment
Build scan URL:
gradle --version
Version of IntelliJ or Android Studio (in About menu you can copy version information)
Android Studio 4.0
Build #AI-193.6911.18.40.6514223, built on May 20, 2020
Runtime version: 1.8.0_242-release-1644-b3-6222593 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.15.5
GC: ParNew, ConcurrentMarkSweep
Memory: 4029M
Cores: 8
Registry: ide.new.welcome.screen.force=true, debugger.watches.in.variables=false
Non-Bundled Plugins: org.jetbrains.kotlin, com.google.services.firebase, com.intellij.jira, com.intellij.marketplace, com.nvlad.tinypng-optimizer, commit-template-idea-plugin, drawable.importer.pluginId.7658.hack', io.github.lizhangqu.intellij.plugin.android.bundle, net.ntworld.nhat-phan.merge-request-integration-ee, wu.seal.tool.jsontokotlin
Version of the Kotlin Plugin used in IntelliJ or Android Studio (in the Configure Kotlin Plugin Updates preference panel)
In this samples, I couldn't find any samples regarding file permission when using
Copy
or working with files relatedMy kotlin gradle custom code here:
Expected Behavior
file permission set correctly to
777
Current Behavior
line
fileMode = 777
doesn't set the permission correctly, see image below:The git console:
Context
Is there any alternative or samples to modify file permission when working with files with kotlin gradle?
Steps to Reproduce (for bugs)
Your Environment
gradle --version
About
menu you can copy version information)Configure Kotlin Plugin Updates
preference panel)