+ my_package="\${1:-}"
+ if [ -z "\$my_package" ]; then
+ >&2 echo "Usage: webi <package>@<version> ..."
+ >&2 echo "Example: webi node@lts rg"
+ exit 1
+ fi
+
+ export WEBI_BOOT="\$(mktemp -d -t "\$my_package-bootstrap.\$WEBI_TIMESTAMP.XXXXXXXX")"
+
+ my_installer_url="\$WEBI_HOST/api/installers/\$my_package.sh?formats=\$my_ext"
+ set +e
+ if [ -n "\$WEBI_CURL" ]; then
+ curl -fsSL "\$my_installer_url" -H "User-Agent: curl \$WEBI_UA" \\
+ -o "\$WEBI_BOOT/\$my_package-bootstrap.sh"
+ else
+ wget -q "\$my_installer_url" --user-agent="wget \$WEBI_UA" \\
+ -O "\$WEBI_BOOT/\$my_package-bootstrap.sh"
+ fi
+ if ! [ \$? -eq 0 ]; then
+ >&2 echo "error fetching '\$my_installer_url'"
+ exit 1
+ fi
+ set -e
+
+ pushd "\$WEBI_BOOT" 2>&1 > /dev/null
+ bash "\$my_package-bootstrap.sh"
+ popd 2>&1 > /dev/null
+
+ rm -rf "\$WEBI_BOOT"
+
+}
+
+show_path_updates() {
+
+ if ! [ -n "\${_WEBI_CHILD}" ]; then
+ if [ -f "\$_webi_tmp/.PATH.env" ]; then
+ my_paths=\$(cat "\$_webi_tmp/.PATH.env" | sort -u)
+ if [ -n "\$my_paths" ]; then
+ echo "IMPORTANT: You must update you PATH to use the installed program(s)"
+ echo ""
+ echo "You can CLOSE and REOPEN Terminal, or RUN these exports:"
+ echo ""
+ echo "\$my_paths"
+ echo ""
+ fi
+ rm -f "\$_webi_tmp/.PATH.env"
+ fi
+ fi
+
+}
+
+for pkgname in "\$@"
+do
+ webinstall "\$pkgname"
+done
+
+show_path_updates