summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2024-07-05 21:21:37 +0200
committerxengineering <me@xengineering.eu>2024-07-05 21:21:37 +0200
commit8af796c9379c697bf56feb9ec4d33b43cdccd472 (patch)
treef730be9d8b996f7d6efe836eb6d67c3df072d790
parente182282eb387d8c73d82e81d2e1fc1aaf5734810 (diff)
downloadcraft-8af796c9379c697bf56feb9ec4d33b43cdccd472.tar
craft-8af796c9379c697bf56feb9ec4d33b43cdccd472.tar.zst
craft-8af796c9379c697bf56feb9ec4d33b43cdccd472.zip
Print current working directory
When craft is used - as intended - as Git post-receive hook the current working directory should always be the .git folder. In case of bare repositories this should point to the bare repository.
-rw-r--r--main.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/main.go b/main.go
index ae97800..5ddc386 100644
--- a/main.go
+++ b/main.go
@@ -11,6 +11,12 @@ import (
)
func main() {
+ cwd, err := os.Getwd()
+ if err != nil {
+ log.Fatal(err)
+ }
+ fmt.Printf("Current working directory: %s\n", cwd)
+
for {
fmt.Println(getUpdate())
}