aarch64 bugfix and minor formatting updates
[webi-installers/.git] / _webi / template.sh
index 651ae99fe967ace54a3d1773e2ea7eec237f051e..4dc0a2ce1c61fae5acf5c4587e71b26e1e9bcd31 100644 (file)
@@ -226,7 +226,6 @@ webi_install() {
     if [ -n "$WEBI_SINGLE" ] || [ "single" == "${1:-}" ]; then
         mkdir -p "$(dirname $pkg_src_cmd)"
         mv ./"$pkg_cmd_name"* "$pkg_src_cmd"
-        chmod a+x "$pkg_src_cmd"
     else
         rm -rf "$pkg_src"
         mv ./"$pkg_cmd_name"* "$pkg_src"
@@ -239,6 +238,12 @@ webi_post_install() {
 }
 
 _webi_enable_exec() {
+    if [ -n "$(command -v spctl)" ] && [ -n "$(command -v xattr)" ] ; then
+        xattr -r -d com.apple.quarantine "$pkg_src"
+        return 0
+    fi
+    # TODO need to test that the above actually worked
+    # (and proceed to this below if it did not)
     if [ -n "$(command -v spctl)" ]; then
         echo "Checking permission to execute '$pkg_cmd_name' on macOS 11+"
         set +e
@@ -315,6 +320,8 @@ if [ -n "$(command -v pkg_get_current_version)" ]; then
     pushd "$WEBI_TMP" 2>&1 >/dev/null
         echo "Installing to $pkg_src_cmd"
         [ -n "$(command -v pkg_install)" ] && pkg_install || webi_install
+        chmod a+x "$pkg_src"
+        chmod a+x "$pkg_src_cmd"
     popd 2>&1 >/dev/null
 
     webi_link