From ca6de894c97c7149d8fb1b8140130cf789c25ec7 Mon Sep 17 00:00:00 2001 From: Rob Mohr Date: Fri, 5 Aug 2022 21:16:20 +0000 Subject: [PATCH] pw_env_setup: Add helper to install CIPD hook Add a helper in util.sh to install the CIPD post-checkout hook. It's not used anywhere, but downstream projects can add it to their local copy of bootstrap.sh. Change-Id: Iaaaeffe1d9fe163ff6b1552618b35dc5808d7c9b Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/105165 Commit-Queue: Rob Mohr Reviewed-by: Anthony DiGirolamo --- pw_env_setup/util.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pw_env_setup/util.sh b/pw_env_setup/util.sh index 4d959505cc..122bfc1025 100644 --- a/pw_env_setup/util.sh +++ b/pw_env_setup/util.sh @@ -295,6 +295,10 @@ pw_finalize() { fi } +pw_install_post_checkout_hook() { + cp "$PW_ROOT/pw_env_setup/post-checkout-hook.sh" "$PW_PROJECT_ROOT/.git/hooks/post-checkout" +} + pw_cleanup() { unset _PW_BANNER unset _PW_BANNER_FUNC @@ -326,6 +330,7 @@ pw_cleanup() { unset -f pw_bootstrap unset -f pw_activate unset -f pw_finalize + unset -f pw_install_post_checkout_hook unset -f pw_cleanup unset -f _pw_hello unset -f pw_error