+ export PATH="$my_path"
+
+ # in case pathman was recently installed and the PATH not updated
+ mkdir -p "$_webi_tmp"
+ # 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
+ webi_pre_install() {
+ webi_check
+ webi_download
+ webi_extract
+ }
+
+ # move commands from the extracted archive directory to $HOME/.local/opt or $HOME/.local/bin
+ # shellcheck disable=2120
+ # webi_install may be sourced and used elsewhere
+ webi_install() {
+ if [ -n "$WEBI_SINGLE" ] || [ "single" == "${1:-}" ]; then
+ mkdir -p "$(dirname "$pkg_src_cmd")"
+ mv ./"$pkg_cmd_name"* "$pkg_src_cmd"
+ else
+ rm -rf "$pkg_src"
+ mv ./"$pkg_cmd_name"* "$pkg_src"
+ fi
+ }
+
+ # run post-install functions - just updating PATH by default
+ webi_post_install() {
+ webi_path_add "$(dirname "$pkg_dst_cmd")"
+ }
+
+ _webi_enable_exec() {
+ if [ -n "$(command -v spctl)" ] && [ -n "$(command -v xattr)" ]; then
+ # 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
+ # (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
+ }
+
+ # a friendly message when all is well, showing the final install path in $HOME/.local
+ _webi_done_message() {
+ echo "Installed $(_webi_canonical_name) as $pkg_dst_cmd"
+ }
+
+ ##
+ ##
+ ## BEGIN custom override functions from <package>/install.sh
+ ##
+ ##
+
+ WEBI_SINGLE=
+
+ if [[ -z ${WEBI_WELCOME:-} ]]; then
+ echo ""
+ printf "Thanks for using webi to install '\e[32m${WEBI_PKG:-}\e[0m' on '\e[31m$(uname -s)/$(uname -m)\e[0m'.\n"
+ echo "Have a problem? Experience a bug? Please let us know:"
+ echo " https://github.com/webinstall/webi-installers/issues"
+ echo ""
+ printf "\e[31mLovin'\e[0m it? Say thanks with a \e[34mStar on GitHub\e[0m:\n"
+ printf " \e[32mhttps://github.com/webinstall/webi-installers\e[0m\n"
+ echo ""