mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-04 03:06:41 -04:00
Support git worktrees
This commit is contained in:
parent
ad8ed41b99
commit
20b8a6973c
@ -3,13 +3,15 @@ static def isLinuxOrMacOs() {
|
|||||||
return osName.contains('linux') || osName.contains('mac os') || osName.contains('macos')
|
return osName.contains('linux') || osName.contains('mac os') || osName.contains('macos')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def gitHooksDir = 'git rev-parse --path-format=absolute --git-path hooks'.execute().text.trim()
|
||||||
|
|
||||||
task copyGitHooks(type: Copy) {
|
task copyGitHooks(type: Copy) {
|
||||||
description 'Copies the git hooks from team-props/git-hooks to the .git folder.'
|
description 'Copies the git hooks from team-props/git-hooks to the .git folder.'
|
||||||
from("${rootDir}/team-props/git-hooks/") {
|
from("${rootDir}/team-props/git-hooks/") {
|
||||||
include '**/*.sh'
|
include '**/*.sh'
|
||||||
rename '(.*).sh', '$1'
|
rename '(.*).sh', '$1'
|
||||||
}
|
}
|
||||||
into "${rootDir}/.git/hooks"
|
into gitHooksDir
|
||||||
}
|
}
|
||||||
|
|
||||||
task installGitHooks(type: Exec) {
|
task installGitHooks(type: Exec) {
|
||||||
@ -17,7 +19,7 @@ task installGitHooks(type: Exec) {
|
|||||||
group 'git hooks'
|
group 'git hooks'
|
||||||
workingDir rootDir
|
workingDir rootDir
|
||||||
commandLine 'chmod'
|
commandLine 'chmod'
|
||||||
args '-R', '+x', '.git/hooks/'
|
args '-R', '+x', gitHooksDir
|
||||||
onlyIf { isLinuxOrMacOs() }
|
onlyIf { isLinuxOrMacOs() }
|
||||||
dependsOn copyGitHooks
|
dependsOn copyGitHooks
|
||||||
doLast {
|
doLast {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user