mostly update comments, fix gitea releases.js

This commit is contained in:
AJ ONeal
2020-06-14 12:31:37 -06:00
parent 36b2f4010b
commit e297427e0b
6 changed files with 34 additions and 12 deletions

View File

@@ -77,12 +77,14 @@
set -e
set -u
pkg_cmd_name="node"
pkg_get_current_version() {
# 'node --version' has output in this format:
# v12.8.0
# This trims it down to just the version number:
# 12.8.0
echo "$(node --version 2>/dev/null | sed 's:^v::')"
echo "$(node --version 2>/dev/null | head -n 1 | cut -d' ' -f1 | sed 's:^v::')"
}
pkg_format_cmd_version() {
@@ -119,8 +121,16 @@ pkg_install() {
# rename the entire extracted folder to the new location
# (this will be "$HOME/.local/opt/node-v$WEBI_VERSION" by default)
# ex (full directory): ./node-v13-linux-amd64/bin/node.exe
mv ./"$pkg_cmd_name"* "$pkg_new_opt"
# ex (single file): ./caddy-v13-linux-amd64.exe
#mv ./"$pkg_cmd_name"* "$pkg_common_cmd"
# ex (single file, nested in directory): ./rg/rg-v13-linux-amd64
#mv ./"$pkg_cmd_name"*/"$pkg_cmd_name"* "$pkg_commend_cmd"
popd 2>&1 >/dev/null
}