From e297427e0b856de8feddadcec50b010da1a72ac1 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 14 Jun 2020 12:31:37 -0600 Subject: [PATCH] mostly update comments, fix gitea releases.js --- caddy/install.bash | 16 +++++++++++++--- flutter/install.bash | 2 ++ gitea/install.bash | 7 ++++--- gitea/releases.js | 4 +--- golang/install.bash | 5 +++-- node/install.bash | 12 +++++++++++- 6 files changed, 34 insertions(+), 12 deletions(-) diff --git a/caddy/install.bash b/caddy/install.bash index c358555..75521b3 100644 --- a/caddy/install.bash +++ b/caddy/install.bash @@ -2,7 +2,7 @@ # homepage: https://github.com/caddyserver/caddy # tagline: Fast, multi-platform web server with automatic HTTPS # description: | -# Caddy is an extensible server platform that uses TLS by default. +# Caddy is an extensible server platform that uses TLS by default. # examples: | # ```bash # caddy start @@ -48,11 +48,21 @@ pkg_pre_install() { pkg_install() { pushd "$WEBI_TMP" 2>&1 >/dev/null - # rename the entire extracted folder to the new location - # (this will be "$HOME/.local/bin/caddy-v$WEBI_VERSION" by default) + # ensure the bin dir exists mkdir -p "$pkg_common_bin" + + # rename the entire extracted folder to the new location + # (this will be "$HOME/.local/bin/caddy", as set above) + + # ex (full directory): ./node-v13-linux-amd64/bin/node.exe + #mv ./"$pkg_cmd_name"* "$pkg_new_opt" + + # ex (single file): ./caddy-v2.0.0-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 } diff --git a/flutter/install.bash b/flutter/install.bash index 1028ede..5962242 100644 --- a/flutter/install.bash +++ b/flutter/install.bash @@ -21,6 +21,8 @@ set -u # # Their defaults are defined in webi/template.bash at https://github.com/webinstall/packages +pkg_cmd_name="flutter" + pkg_get_current_version() { # 'flutter --version' outputs a lot of information: # Flutter 1.19.0-4.1.pre • channel beta • https://github.com/flutter/flutter.git diff --git a/gitea/install.bash b/gitea/install.bash index 17fc587..171c03e 100644 --- a/gitea/install.bash +++ b/gitea/install.bash @@ -1,16 +1,17 @@ # title: Gitea # homepage: https://github.com/go-gitea/gitea -# tagline: Fast, multi-platform web server with automatic HTTPS +# tagline: Git with a cup of tea, painless self-hosted git service # description: | -# Caddy is an extensible server platform that uses TLS by default. +# `gitea` is a clean, lightweight self-hosted Github alternative, forked from Gogs. Lighter and more user-friendly than Gitlab. # examples: | # ```bash -# gitea start +# gitea --version # ``` set -e set -u +pkg_cmd_name="gitea" pkg_common_opt="$HOME/.local" # just a junk file so that the version check always fails for non-current versions diff --git a/gitea/releases.js b/gitea/releases.js index 80eb1bb..5895554 100644 --- a/gitea/releases.js +++ b/gitea/releases.js @@ -8,7 +8,7 @@ module.exports = function (request) { return github(request, owner, repo).then(function (all) { // remove checksums and .deb all.releases = all.releases.filter(function (rel) { - return !/(\.asc)|(\.sha256)|(\.\d-[^\.]*)$/i.test(rel.name); + return !/(\.txt)|(\.deb)|(\.asc)|(\.sha256)$/i.test(rel.name); }); return all; }); @@ -16,8 +16,6 @@ module.exports = function (request) { if (module === require.main) { module.exports(require('@root/request')).then(function (all) { - all = require('../_common/normalize.js')(all); console.info(JSON.stringify(all)); - //console.info(JSON.stringify(all, null, 2)); }); } diff --git a/golang/install.bash b/golang/install.bash index 017bdc6..fead4b6 100644 --- a/golang/install.bash +++ b/golang/install.bash @@ -53,7 +53,7 @@ pkg_get_current_version() { # go version go1.14.2 darwin/amd64 # This trims it down to just the version number: # 1.14.2 - echo "$(go version | cut -d' ' -f3 | sed 's:go::')" + echo "$(go version >2/dev/null | head -n 1 | cut -d' ' -f3 | sed 's:go::')" } pkg_format_cmd_version() { @@ -101,7 +101,7 @@ pkg_install() { # rename the entire extracted folder to the new location # (this will be "$HOME/.local/opt/go-v$WEBI_VERSION" by default) - mv ./go* "$pkg_new_opt" + mv ./"$pkg_cmd_name"* "$pkg_new_opt" popd 2>&1 >/dev/null } @@ -116,6 +116,7 @@ pkg_post_install() { webi_path_add "$GOBIN/bin" # Install x go + echo "Installing go extended tools (goimports, gorename, etc)" "$pkg_common_cmd" get golang.org/x/tools/cmd/goimports > /dev/null 2>/dev/null "$pkg_common_cmd" get golang.org/x/tools/cmd/gorename > /dev/null 2>/dev/null "$pkg_common_cmd" get golang.org/x/tools/cmd/gotype > /dev/null 2>/dev/null diff --git a/node/install.bash b/node/install.bash index 4dba6c3..15feaf8 100644 --- a/node/install.bash +++ b/node/install.bash @@ -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 } -- 2.25.1