ref: rename to package-install.tpl.sh to match namespace style

This commit is contained in:
AJ ONeal
2023-11-18 15:33:51 -07:00
parent e39e9722d7
commit a4a386dd8a
4 changed files with 12 additions and 13 deletions

View File

@@ -55,7 +55,7 @@ Releases.renderBash = async function (
};
var pkgFile = rel.filename || rel.name;
let tplTxt = await Fs.readFile(
path.join(__dirname, 'install-package.tpl.sh'),
path.join(__dirname, 'package-install.tpl.sh'),
'utf8',
);
// ex: 'node@lts' or 'node'
@@ -173,7 +173,7 @@ Releases.renderPowerShell = async function (
};
*/
let tplTxt = await Fs.readFile(
path.join(__dirname, 'install-package.tpl.ps1'),
path.join(__dirname, 'package-install.tpl.ps1'),
'utf8',
);
var pkgver = pkg + '@' + ver;

View File

@@ -87,39 +87,38 @@ __webi_main() {
webinstall() {
my_package="${1:-}"
if [ -z "$my_package" ]; then
b_package="${1:-}"
if test -z "${b_package}"; then
echo >&2 "Usage: webi <package>@<version> ..."
echo >&2 "Example: webi node@lts rg"
exit 1
fi
WEBI_BOOT="$(
mktemp -d -t "$my_package-bootstrap.$WEBI_TIMESTAMP.XXXXXXXX"
b_install_tmpdir="$(
mktemp -d -t "${b_package}-install.${WEBI_TIMESTAMP}.XXXXXXXX"
)"
export WEBI_BOOT
my_installer_url="$WEBI_HOST/api/installers/$my_package.sh?formats=$my_ext"
my_installer_url="$WEBI_HOST/api/installers/${b_package}.sh?formats=${my_ext}"
if [ -n "$WEBI_CURL" ]; then
if ! curl -fsSL "$my_installer_url" -H "User-Agent: curl $WEBI_UA" \
-o "$WEBI_BOOT/$my_package-bootstrap.sh"; then
-o "${b_install_tmpdir}/${b_package}-install.sh"; then
echo >&2 "error fetching '$my_installer_url'"
exit 1
fi
else
if ! wget -q "$my_installer_url" --user-agent="wget $WEBI_UA" \
-O "$WEBI_BOOT/$my_package-bootstrap.sh"; then
-O "${b_install_tmpdir}/${b_package}-install.sh"; then
echo >&2 "error fetching '$my_installer_url'"
exit 1
fi
fi
(
cd "$WEBI_BOOT"
sh "$my_package-bootstrap.sh"
cd "${b_install_tmpdir}"
sh "${b_package}-install.sh"
)
rm -rf "$WEBI_BOOT"
rm -rf "${b_install_tmpdir}"
}