diff options
author | Runxi Yu <me@runxiyu.org> | 2025-03-29 22:06:10 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-03-29 22:06:10 +0800 |
commit | 395e3ec3ce663254bf97fe9900760cf051bd1ed9 (patch) | |
tree | fb6f00b121b0106622ff292ed31ebc082e4ae9aa /git_hooks_deploy.go | |
parent | Make git_hooks_handle portable ish? (diff) | |
download | forge-395e3ec3ce663254bf97fe9900760cf051bd1ed9.tar.gz forge-395e3ec3ce663254bf97fe9900760cf051bd1ed9.tar.zst forge-395e3ec3ce663254bf97fe9900760cf051bd1ed9.zip |
Don't error out because the symlink exists
Diffstat (limited to '')
-rw-r--r-- | git_hooks_deploy.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/git_hooks_deploy.go b/git_hooks_deploy.go index 86df6e3..5952c83 100644 --- a/git_hooks_deploy.go +++ b/git_hooks_deploy.go @@ -4,6 +4,7 @@ package main import ( + "errors" "io" "io/fs" "os" @@ -48,7 +49,10 @@ func deployHooks() (err error) { "pre-receive", } { if err = os.Symlink(filepath.Join(config.Hooks.Execs, "hookc"), filepath.Join(config.Hooks.Execs, hookName)); err != nil { - return err + if !errors.Is(err, fs.ErrExist) { + return err + } + // TODO: Maybe check if it points to the right place? } } |