]> gitweb.fluxo.info Git - hydra.git/commitdiff
Fix: hydractl: trac-upgrade: check for Trac installation
authorSilvio Rhatto <rhatto@riseup.net>
Tue, 26 Dec 2023 04:56:46 +0000 (01:56 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Tue, 26 Dec 2023 04:56:46 +0000 (01:56 -0300)
share/hydractl/trac-upgrade

index 31e8f529f94cf5acc087e8a69ca079a596d0cad0..c5774f94cc5ac8cc6f5710a3d0fa26c118116e3f 100755 (executable)
@@ -30,6 +30,15 @@ fi
 
 # Upgrade
 for instance in `find $BASE -maxdepth 2 -name trac`; do
+  # Check for Trac
+  #
+  # Do this inside the loop to avoid giving an error
+  # message if there's no trac instance
+  if ! which trac-admin &> /dev/null; then
+    echo "Could not find a trac-admin executable, aborting"
+    exit 1
+  fi
+
   (
     echo "Upgrading trac instance $instance..."
     cd $instance