diff options
| author | Anton Medvedev <anton@medv.io> | 2025-12-07 15:52:48 +0100 |
|---|---|---|
| committer | Anton Medvedev <anton@medv.io> | 2025-12-07 15:52:48 +0100 |
| commit | 484203dc66ad90f38cd990a17898d51ca39c8740 (patch) | |
| tree | e4ea41404f95b5b28bacae4ef74e1ca272137a9c | |
| parent | c34b92e8e2690892355ab03e0228e71d03cf8a72 (diff) | |
Remove `NO_OUTPUT_DIR_CHECK` and check
| -rw-r--r-- | docs/how-to-self-host-a-git-repository.md | 2 | ||||
| -rw-r--r-- | main.go | 11 |
2 files changed, 1 insertions, 12 deletions
diff --git a/docs/how-to-self-host-a-git-repository.md b/docs/how-to-self-host-a-git-repository.md index f8dd84b..d4b0a3f 100644 --- a/docs/how-to-self-host-a-git-repository.md +++ b/docs/how-to-self-host-a-git-repository.md @@ -38,7 +38,7 @@ Create a [post‑receive](https://git-scm.com/docs/git-receive-pack#_post_receiv ```sh #!/bin/sh -NO_OUTPUT_DIR_CHECK=1 /path-to/gitmal --output /home/git/public/repo/ +exec gitmal --output /home/git/public/repo/ ``` Make the hook executable: @@ -56,7 +56,6 @@ func main() { _, noFiles := os.LookupEnv("NO_FILES") _, noCommitsList := os.LookupEnv("NO_COMMITS_LIST") - _, noOutputDirCheck := os.LookupEnv("NO_OUTPUT_DIR_CHECK") flag.StringVar(&flagOwner, "owner", "", "Project owner") flag.StringVar(&flagName, "name", "", "Project name") @@ -89,16 +88,6 @@ func main() { panic(err) } - if !noOutputDirCheck { - if fi, err := os.Stat(outputDir); err == nil && fi.IsDir() { - if entries, err := os.ReadDir(outputDir); err == nil && len(entries) > 0 { - echo(fmt.Sprintf("Output directory %q is not empty.", outputDir)) - echo("Please remove its contents or choose a different --output directory.") - os.Exit(1) - } - } - } - absInput, err := filepath.Abs(input) if err != nil { panic(err) |
