From 8af796c9379c697bf56feb9ec4d33b43cdccd472 Mon Sep 17 00:00:00 2001 From: xengineering Date: Fri, 5 Jul 2024 21:21:37 +0200 Subject: 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. --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) 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()) } -- cgit v1.2.3-70-g09d2