[skip ci] add comments
This commit is contained in:
parent
b0876878f1
commit
13cad5b170
1 changed files with 3 additions and 0 deletions
|
@ -24,6 +24,8 @@ fun Prov.gitClone(
|
||||||
?: return@taskWithResult ProvResult(false, err = "$repoSource is not a valid git repository source path.")
|
?: return@taskWithResult ProvResult(false, err = "$repoSource is not a valid git repository source path.")
|
||||||
|
|
||||||
val pathWithBasename = targetPath.normalizePath() + basename
|
val pathWithBasename = targetPath.normalizePath() + basename
|
||||||
|
|
||||||
|
// check if repo is already on target machine
|
||||||
if (checkDir(pathWithBasename + "/.git/")) {
|
if (checkDir(pathWithBasename + "/.git/")) {
|
||||||
if (pullIfExisting) {
|
if (pullIfExisting) {
|
||||||
cmd("cd $pathWithBasename && git pull")
|
cmd("cd $pathWithBasename && git pull")
|
||||||
|
@ -31,6 +33,7 @@ fun Prov.gitClone(
|
||||||
ProvResult(true, out = "Repo [$pathWithBasename] already exists, but might not be up-to-date.")
|
ProvResult(true, out = "Repo [$pathWithBasename] already exists, but might not be up-to-date.")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
// create targetPath (if not yet existing)
|
||||||
if (!checkDir(targetPath)) {
|
if (!checkDir(targetPath)) {
|
||||||
createDirs(targetPath)
|
createDirs(targetPath)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue