+ webi_path_add "$(dirname "$pkg_dst_cmd")"
+}
+
+_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
+ is_allowed="$(spctl -a "$pkg_src_cmd" 2>&1 | grep valid)"
+ set -e
+ if [ -z "$is_allowed" ]; then
+ echo ""
+ echo "##########################################"
+ echo "# IMPORTANT: Permission Grant Required #"
+ echo "##########################################"
+ echo ""
+ echo "Requesting permission to execute '$pkg_cmd_name' on macOS 10.14+"
+ echo ""
+ sleep 3
+ spctl --add "$pkg_src_cmd"
+ fi
+ fi