-set -e
-set -u
-
-{
-
-export WEBI_TIMESTAMP=\$(date +%F_%H-%M-%S)
-export _webi_tmp="\${_webi_tmp:-\$(mktemp -d -t webi-\$WEBI_TIMESTAMP.XXXXXXXX)}"
-
-if [ -n "\${_WEBI_PARENT:-}" ]; then
- export _WEBI_CHILD=true
-else
- export _WEBI_CHILD=
-fi
-export _WEBI_PARENT=true
-
-##
-## Detect acceptable package formats
-##
-
-my_ext=""
-set +e
-# NOTE: the order here is least favorable to most favorable
-if [ -n "\$(command -v pkgutil)" ]; then
- my_ext="pkg,\$my_ext"
-fi
-# disable this check for the sake of building the macOS installer on Linux
-#if [ -n "\$(command -v diskutil)" ]; then
- # note: could also detect via hdiutil
- my_ext="dmg,\$my_ext"
-#fi
-if [ -n "\$(command -v git)" ]; then
- my_ext="git,\$my_ext"
-fi
-if [ -n "\$(command -v unxz)" ]; then
- my_ext="xz,\$my_ext"
-fi
-if [ -n "\$(command -v unzip)" ]; then
- my_ext="zip,\$my_ext"
-else
- if [ -n "\$(command -v apt-get)" ]; then
- >&2 echo "WARN: please install 'unzip':"
- >&2 echo " sudo apt-get install -y unzip"
- else
- >&2 echo "WARN: 'unzip' not found"
- fi
-fi
-if [ -n "\$(command -v tar)" ]; then
- my_ext="tar,\$my_ext"
-fi
-my_ext="\$(echo "\$my_ext" | sed 's/,$//')" # nix trailing comma
-set -e