From 5fabdc4760c2f6448b4ad36a7838b45f2d7840ab Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Wed, 29 Jul 2020 23:53:05 -0600 Subject: [PATCH 1/4] hotfix to remove trailing '}' from bin names --- _webi/template.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_webi/template.sh b/_webi/template.sh index aaf32e0..1dc0506 100644 --- a/_webi/template.sh +++ b/_webi/template.sh @@ -294,8 +294,8 @@ if [ -n "$(command -v pkg_get_current_version)" ]; then pkg_dst_cmd="${pkg_dst_cmd:-$HOME/.local/bin/$pkg_cmd_name}" pkg_dst="$pkg_dst_cmd" # "$(dirname "$(dirname $pkg_dst_cmd)")" - #pkg_src_cmd="${pkg_src_cmd:-$HOME/.local/opt/$pkg_cmd_name-v$WEBI_VERSION}/bin/$pkg_cmd_name-v$WEBI_VERSION}" - pkg_src_cmd="${pkg_src_cmd:-$HOME/.local/opt/$pkg_cmd_name-v$WEBI_VERSION}/bin/$pkg_cmd_name}" + #pkg_src_cmd="${pkg_src_cmd:-$HOME/.local/opt/$pkg_cmd_name-v$WEBI_VERSION/bin/$pkg_cmd_name-v$WEBI_VERSION}" + pkg_src_cmd="${pkg_src_cmd:-$HOME/.local/opt/$pkg_cmd_name-v$WEBI_VERSION/bin/$pkg_cmd_name}" pkg_src="$pkg_src_cmd" # "$(dirname "$(dirname $pkg_src_cmd)")" else pkg_dst="${pkg_dst:-$HOME/.local/opt/$pkg_cmd_name}" From 8fa367de83c4ce9e8808e78735a58834ebcc9e74 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 30 Jul 2020 00:35:34 -0600 Subject: [PATCH 2/4] hotfix for github release API rate limit token --- .gitignore | 1 + _common/github.js | 16 ++++++++++++++-- package-lock.json | 5 +++++ package.json | 1 + 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 7821601..a1144c9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.env node_modules install-*.sh install-*.bat diff --git a/_common/github.js b/_common/github.js index 442b16b..aa98074 100644 --- a/_common/github.js +++ b/_common/github.js @@ -1,5 +1,7 @@ 'use strict'; +require('dotenv').config(); + /** * Gets the releases for 'ripgrep'. This function could be trimmed down and made * for use with any github release. @@ -21,10 +23,20 @@ function getAllReleases( if (!repo) { return Promise.reject('missing repo name'); } - return request({ + + var req = { url: `${baseurl}/repos/${owner}/${repo}/releases`, json: true - }).then((resp) => { + }; + // TODO I really don't like global config, find a way to do better + if (process.env.GITHUB_USERNAME) { + req.auth = { + user: process.env.GITHUB_USERNAME, + pass: process.env.GITHUB_TOKEN + }; + } + + return request(req).then((resp) => { const gHubResp = resp.body; const all = { releases: [], diff --git a/package-lock.json b/package-lock.json index 69f044a..304b4e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,11 @@ "resolved": "https://registry.npmjs.org/@root/request/-/request-1.6.1.tgz", "integrity": "sha512-8wrWyeBLRp7T8J36GkT3RODJ6zYmL0/maWlAUD5LOXT28D3TDquUepyYDKYANNA3Gc8R5ZCgf+AXvSTYpJEWwQ==" }, + "dotenv": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", + "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" + }, "marked": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/marked/-/marked-1.1.0.tgz", diff --git a/package.json b/package.json index 105bbe4..a6961af 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "homepage": "https://github.com/webinstall/packages#readme", "dependencies": { "@root/request": "^1.6.1", + "dotenv": "^8.2.0", "shmatter": "^1.0.1" } } From 24bef330c7dec03b08c0559b42f9c09e2df862a7 Mon Sep 17 00:00:00 2001 From: yollotltamayo Date: Wed, 29 Jul 2020 22:37:30 -0500 Subject: [PATCH 3/4] agregate the download source #63 --- _webi/template.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/_webi/template.sh b/_webi/template.sh index 1dc0506..4ace514 100644 --- a/_webi/template.sh +++ b/_webi/template.sh @@ -147,8 +147,8 @@ webi_download() { return 0 fi - echo "Downloading $PKG_NAME to $my_dl" - + echo "Downloading $PKG_NAME from:" + echo -e "\e]8;;$WEBI_PKG_URL\a$WEBI_PKG_URL\e]8;;\a" # It's only 2020, we can't expect to have reliable CLI tools # to tell us the size of a file as part of a base system... if [ -n "$WEBI_WGET" ]; then @@ -166,7 +166,8 @@ webi_download() { # TODO curl -fsSL --remote-name --remote-header-name --write-out "$my_url" curl -fSL -H "User-Agent: curl $WEBI_UA" "$my_url" -o "$my_dl.part" fi - + echo "" + echo "Saved as $my_dl" mv "$my_dl.part" "$my_dl" } From 4e9b4f81b1cf57d96a100d1ee16d937b028e920c Mon Sep 17 00:00:00 2001 From: yollotltamayo Date: Thu, 30 Jul 2020 11:09:54 -0500 Subject: [PATCH 4/4] fixed issue #63 --- _webi/template.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_webi/template.sh b/_webi/template.sh index 4ace514..c595d90 100644 --- a/_webi/template.sh +++ b/_webi/template.sh @@ -147,8 +147,8 @@ webi_download() { return 0 fi - echo "Downloading $PKG_NAME from:" - echo -e "\e]8;;$WEBI_PKG_URL\a$WEBI_PKG_URL\e]8;;\a" + echo "Downloading $PKG_NAME from:" #Show the package and the source URL + echo "$WEBI_PKG_URL" # It's only 2020, we can't expect to have reliable CLI tools # to tell us the size of a file as part of a base system... if [ -n "$WEBI_WGET" ]; then @@ -167,7 +167,7 @@ webi_download() { curl -fSL -H "User-Agent: curl $WEBI_UA" "$my_url" -o "$my_dl.part" fi echo "" - echo "Saved as $my_dl" + echo "Saved as $my_dl" #Show the path of the package mv "$my_dl.part" "$my_dl" }