# 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
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
}
#
# 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
# 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
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;
});
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));
});
}
# 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() {
# 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
}
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
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() {
# 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
}