workarounds for fluter
[webi-installers/.git] / _webi / template.sh
index 4dc0a2ce1c61fae5acf5c4587e71b26e1e9bcd31..6ca7bbfe73579537d1216dd29552bae0bada3485 100644 (file)
@@ -211,7 +211,8 @@ webi_path_add() {
 
     # in case pathman was recently installed and the PATH not updated
     mkdir -p "$_webi_tmp"
-    "$HOME/.local/bin/pathman" add "$1" | grep "export" >> "$_webi_tmp/.PATH.env" || true
+    # prevent "too few arguments" output on bash when there are 0 lines of stdout
+    "$HOME/.local/bin/pathman" add "$1" | grep "export" 2>/dev/null >> "$_webi_tmp/.PATH.env" || true
 }
 
 # group common pre-install tasks as default
@@ -239,7 +240,8 @@ webi_post_install() {
 
 _webi_enable_exec() {
     if [ -n "$(command -v spctl)" ] && [ -n "$(command -v xattr)" ] ; then
-        xattr -r -d com.apple.quarantine "$pkg_src"
+        # note: some packages contain files that cannot be affected by xattr
+        xattr -r -d com.apple.quarantine "$pkg_src" || true
         return 0
     fi
     # TODO need to test that the above actually worked