From 13cad5b1704773d6c57bbd63b08a8f5fb0c6d924 Mon Sep 17 00:00:00 2001 From: ansgarz Date: Thu, 21 Apr 2022 18:27:04 +0200 Subject: [PATCH] [skip ci] add comments --- .../provs/framework/ubuntu/git/base/Git.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/git/base/Git.kt b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/git/base/Git.kt index 2e670f5..9209be4 100644 --- a/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/git/base/Git.kt +++ b/src/main/kotlin/org/domaindrivenarchitecture/provs/framework/ubuntu/git/base/Git.kt @@ -24,6 +24,8 @@ fun Prov.gitClone( ?: return@taskWithResult ProvResult(false, err = "$repoSource is not a valid git repository source path.") val pathWithBasename = targetPath.normalizePath() + basename + + // check if repo is already on target machine if (checkDir(pathWithBasename + "/.git/")) { if (pullIfExisting) { 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.") } } else { + // create targetPath (if not yet existing) if (!checkDir(targetPath)) { createDirs(targetPath) }