diff options
author | Brice Waegeneire <brice@waegenei.re> | 2025-06-22 14:19:30 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2025-06-30 14:30:40 +0200 |
commit | 715b38815f036cd7e0013dc59c386e3378041bfa (patch) | |
tree | 9ddad48ba2e5589e6dfe033850eb444499a72172 | |
parent | c6b4fe16f467cca745bcbb0acd75a5eb35d22a50 (diff) |
git authenticate: Create Git hooks directory.
* guix/scripts/git/authenticate.scm (install-hooks): Create Git hooks
directory if necessary.
Change-Id: Icb9b0674d42af78fe03a3c820369f8324db960b4
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r-- | guix/scripts/git/authenticate.scm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/guix/scripts/git/authenticate.scm b/guix/scripts/git/authenticate.scm index c80fde42b4..3349a54ebf 100644 --- a/guix/scripts/git/authenticate.scm +++ b/guix/scripts/git/authenticate.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020, 2024, 2025 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2025 Brice Waegeneire <brice@waegenei.re> ;;; ;;; This file is part of GNU Guix. ;;; @@ -18,6 +19,7 @@ (define-module (guix scripts git authenticate) #:use-module (git) + #:use-module (guix build utils) #:use-module (guix ui) #:use-module (guix scripts) #:use-module (guix git-authenticate) @@ -166,14 +168,16 @@ done\n") (define (install-hooks repository) "Attempt to install in REPOSITORY hooks that invoke 'guix git authenticate'. Bail out if one of these already exists." - (define directory - (repository-common-directory repository)) + (define hooks-directory + (in-vicinity (repository-common-directory repository) "hooks")) (define pre-push-hook - (in-vicinity directory "hooks/pre-push")) + (in-vicinity hooks-directory "pre-push")) (define post-merge-hook - (in-vicinity directory "hooks/post-merge")) + (in-vicinity hooks-directory "post-merge")) + + (mkdir-p hooks-directory) (if (or (file-exists? pre-push-hook) (file-exists? post-merge-hook)) |