Browse Source

ref: use the local devenv install if available for post-merge hook (#65804)

<!-- Describe your PR here. -->
anthony sottile 1 year ago
parent
commit
12af4dae78
1 changed files with 7 additions and 2 deletions
  1. 7 2
      config/hooks/post-merge

+ 7 - 2
config/hooks/post-merge

@@ -19,12 +19,17 @@ if grep --quiet 'requirements-dev-frozen.txt' "$files_changed_upstream" || grep
 EOF
 
   if [[ "$SENTRY_POST_MERGE_AUTO_UPDATE" ]]; then
+    if [ -f .venv/bin/devenv ]; then
+        DEVENV=.venv/bin/devenv
+    else
+        DEVENV=devenv
+    fi
     echo "${yellow}Automatically running devenv sync because SENTRY_POST_MERGE_AUTO_UPDATE is set.${reset}"
-    if ! command -v devenv >/dev/null 2>&1; then
+    if ! command -v "$DEVENV" >/dev/null 2>&1; then
         echo "devenv not found! install: https://github.com/getsentry/devenv#install"
         exit 1
     fi
-    devenv sync
+    "$DEVENV" sync
   else
     echo "${yellow}If you want devenv sync to be executed automatically after pulling code, you can export the SENTRY_POST_MERGE_AUTO_UPDATE variable.${reset}"
   fi