return 0
fi
- echo "Downloading $PKG_NAME from:" #Show the package and the source URL
- echo "$WEBI_PKG_URL"
+ echo "Downloading $PKG_NAME from"
+ echo "$my_url"
+
# It's only 2020, we can't expect to have reliable CLI tools
# to tell us the size of a file as part of a base system...
if [ -n "$WEBI_WGET" ]; then
# TODO curl -fsSL --remote-name --remote-header-name --write-out "$my_url"
curl -fSL -H "User-Agent: curl $WEBI_UA" "$my_url" -o "$my_dl.part"
fi
- echo ""
- echo "Saved as $my_dl" #Show the path of the package
mv "$my_dl.part" "$my_dl"
+
+ echo ""
+ echo "Saved as $my_dl"
}
# detect which archives can be used
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"
}
_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
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
+ _webi_enable_exec
pushd "$WEBI_TMP" 2>&1 >/dev/null
[ -n "$(command -v pkg_post_install)" ] && pkg_post_install || webi_post_install
popd 2>&1 >/dev/null
- _webi_enable_exec
pushd "$WEBI_TMP" 2>&1 >/dev/null
[ -n "$(command -v pkg_done_message)" ] && pkg_done_message || _webi_done_message