aboutsummaryrefslogtreecommitdiff
path: root/git_hooks_deploy.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-18 10:23:44 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-18 10:23:44 +0800
commitdd95e2dbfad7f39060dc70f145d0e1478770e454 (patch)
tree863f9c3a941f21a66fe0af1cbe9a09ae444c8a46 /git_hooks_deploy.go
parentREADME.md: Mention that anonymous pushes to contrib/ are possible now (diff)
downloadforge-dd95e2dbfad7f39060dc70f145d0e1478770e454.tar.gz
forge-dd95e2dbfad7f39060dc70f145d0e1478770e454.tar.zst
forge-dd95e2dbfad7f39060dc70f145d0e1478770e454.zip
*.go: Add some comments for docs
Diffstat (limited to 'git_hooks_deploy.go')
-rw-r--r--git_hooks_deploy.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/git_hooks_deploy.go b/git_hooks_deploy.go
index eaffb5b..7ac24c2 100644
--- a/git_hooks_deploy.go
+++ b/git_hooks_deploy.go
@@ -7,6 +7,9 @@ import (
"path/filepath"
)
+// deploy_hooks_to_filesystem deploys the git hooks client to the filesystem.
+// The git hooks client is expected to be embedded in resources_fs and must be
+// pre-compiled during the build process; see the Makefile.
func deploy_hooks_to_filesystem() (err error) {
err = func() error {
src_fd, err := resources_fs.Open("git_hooks_client/git_hooks_client")
@@ -32,6 +35,8 @@ func deploy_hooks_to_filesystem() (err error) {
return err
}
+ // Go's embed filesystems do not store permissions; but in any case,
+ // they would need to be 0o755:
err = os.Chmod(filepath.Join(config.Hooks.Execs, "git_hooks_client"), 0o755)
if err != nil {
return err