From 94becf0eaef6cfcc92b9b41572c74a6426f428a5 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 3 Jul 2020 06:19:46 +0000 Subject: [PATCH] minor cleanup --- node/install.ps1 | 7 +++---- rg/install.sh | 36 +++++++++++++++++++----------------- rg/releases.js | 1 + ripgrep/releases.js | 1 + 4 files changed, 24 insertions(+), 21 deletions(-) diff --git a/node/install.ps1 b/node/install.ps1 index a7fe891..c108acb 100644 --- a/node/install.ps1 +++ b/node/install.ps1 @@ -18,14 +18,13 @@ IF (!(Test-Path -Path "$Env:USERPROFILE\.local\opt\$Env:PKG_NAME-v$Env:WEBI_VERS # Enter opt pushd .local\tmp - echo "Remove leftover node-v* stuffs" + # Remove any leftover tmp cruft Remove-Item -Path "node-v*" -Recurse -ErrorAction Ignore # Unpack archive # Windows BSD-tar handles zip. Imagine that. echo "Unpacking $Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE" & tar xf "$Env:USERPROFILE\Downloads\$Env:WEBI_PKG_FILE" - Get-ChildItem "node-v*" # Settle unpacked archive into place echo "New Name: $Env:PKG_NAME-v$Env:WEBI_VERSION" @@ -37,8 +36,8 @@ IF (!(Test-Path -Path "$Env:USERPROFILE\.local\opt\$Env:PKG_NAME-v$Env:WEBI_VERS popd } -echo "Versioning $Env:PKG_NAME" -Remove-Item -Path "$Env:USERPROFILE\.local\opt\node" -Recurse -ErrorAction Ignore +echo "Copying into '$Env:USERPROFILE\.local\opt\$Env:PKG_NAME' from '$Env:USERPROFILE\.local\opt\$Env:PKG_NAME-v$Env:WEBI_VERSION'" +Remove-Item -Path "$Env:USERPROFILE\.local\opt\$Env:PKG_NAME" -Recurse -ErrorAction Ignore Copy-Item -Path "$Env:USERPROFILE\.local\opt\$Env:PKG_NAME-v$Env:WEBI_VERSION" -Destination "$Env:USERPROFILE\.local\opt\$Env:PKG_NAME" -Recurse # make npm not act stupid about which node to use... ugh (this should be the default) diff --git a/rg/install.sh b/rg/install.sh index eb3cc3b..843bbe3 100644 --- a/rg/install.sh +++ b/rg/install.sh @@ -1,24 +1,26 @@ -set -e -set -u +{ + set -e + set -u -################### -# Install ripgrep # -################### + ################### + # Install ripgrep # + ################### -new_rg="${HOME}/.local/bin/rg" -WEBI_SINGLE=true + new_rg="${HOME}/.local/bin/rg" + WEBI_SINGLE=true -pkg_get_current_version() { - echo $(rg --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2) -} + pkg_get_current_version() { + echo $(rg --version 2>/dev/null | head -n 1 | cut -d ' ' -f 2) + } -pkg_install() { - # $HOME/.local/xbin - mkdir -p "$pkg_src_bin" + pkg_install() { + # $HOME/.local/xbin + mkdir -p "$pkg_src_bin" - # mv ./ripgrep-*/rg "$HOME/.local/xbin/rg-v11.1.0" - mv ./ripgrep-*/rg "$pkg_src_cmd" + # mv ./ripgrep-*/rg "$HOME/.local/xbin/rg-v11.1.0" + mv ./ripgrep-*/rg "$pkg_src_cmd" - # chmod a+x "$HOME/.local/xbin/rg-v11.1.0" - chmod a+x "$pkg_src_cmd" + # chmod a+x "$HOME/.local/xbin/rg-v11.1.0" + chmod a+x "$pkg_src_cmd" + } } diff --git a/rg/releases.js b/rg/releases.js index 6fd4f62..2ebc97d 100644 --- a/rg/releases.js +++ b/rg/releases.js @@ -12,6 +12,7 @@ module.exports = function (request) { if (module === require.main) { module.exports(require('@root/request')).then(function (all) { + all = require('../_webi/normalize.js')(all); console.info(JSON.stringify(all)); //console.info(JSON.stringify(all, null, 2)); }); diff --git a/ripgrep/releases.js b/ripgrep/releases.js index 6fd4f62..2ebc97d 100644 --- a/ripgrep/releases.js +++ b/ripgrep/releases.js @@ -12,6 +12,7 @@ module.exports = function (request) { if (module === require.main) { module.exports(require('@root/request')).then(function (all) { + all = require('../_webi/normalize.js')(all); console.info(JSON.stringify(all)); //console.info(JSON.stringify(all, null, 2)); }); -- 2.25.1