From 4bff1b4f3921b39134fbf3e0c3624d2fab15f201 Mon Sep 17 00:00:00 2001 From: Tin Lai Date: Thu, 25 May 2023 01:36:05 +1000 Subject: [PATCH 1/9] update junest wrapper and handling of args Signed-off-by: Tin Lai --- libexec/shsh | 2 +- libexec/shsh-junest | 77 +++++++++++++++++++----------------- man/man1/shsh-cleanup.1 | 5 ++- man/man1/shsh-commands.1 | 5 ++- man/man1/shsh-completions.1 | 5 ++- man/man1/shsh-edit.1 | 5 ++- man/man1/shsh-get.1 | 5 ++- man/man1/shsh-help.1 | 5 ++- man/man1/shsh-init.1 | 5 ++- man/man1/shsh-install.1 | 29 ++++++-------- man/man1/shsh-junest.1 | 47 ++++++++++++++++++++++ man/man1/shsh-link.1 | 5 ++- man/man1/shsh-list.1 | 5 ++- man/man1/shsh-outdated.1 | 5 ++- man/man1/shsh-package-path.1 | 5 ++- man/man1/shsh-refresh.1 | 5 ++- man/man1/shsh-self-upgrade.1 | 5 ++- man/man1/shsh-uninstall.1 | 5 ++- man/man1/shsh-upgrade.1 | 5 ++- man/man1/shsh.1 | 49 ++++++++++++++--------- 20 files changed, 175 insertions(+), 104 deletions(-) create mode 100644 man/man1/shsh-junest.1 diff --git a/libexec/shsh b/libexec/shsh index 3c942e3..b945657 100755 --- a/libexec/shsh +++ b/libexec/shsh @@ -116,7 +116,7 @@ for arg; do ;; --version) cat << EOF -shsh (shell script handler) v2.8.2 +shsh (shell script handler) v3.0.0 Copyright (c) 2014 Juan Ibiapina, 2020 Tin Lai (@soraxas) This is free software; see the source for copying conditions. There is NO diff --git a/libexec/shsh-junest b/libexec/shsh-junest index eaa1c0c..317a0b9 100755 --- a/libexec/shsh-junest +++ b/libexec/shsh-junest @@ -2,10 +2,11 @@ # # Summary: A transparently wrapper of junest with custom ignoring bins # Usage: shsh junest [-h|--help] +# shsh junest enter [argunments for junest...] # shsh junest link # shsh junest unlink -# shsh junest linkable [package] -# shsh junest linked +# shsh junest linkable [package] [-d|--details] +# shsh junest linked [-d|--details] # shsh junest packages [-d|--details] # shsh junest lookup # @@ -13,44 +14,40 @@ # packages from the arch linux community AUR via yay. # After bootstrapping, you can directly install packages via yay. + set -e -# TAG completions -if [ "$1" = "--complete" ]; then - printf '%s\n' link unlink linked linkable lookup packages - exit -fi +export JUNEST_HOME="${SHSH_ROOT:?Root directory for shsh has not been defined.}/cellar/arch_junest_root/junest" +junest_bin_root="$JUNEST_HOME/usr/bin_wrappers" -resolve_link() { - if type greadlink >/dev/null 2>&1; then - greadlink -f "$1" - else - if ! readlink -f "$1" 2>/dev/null; then - # use self-implemented `readlink -f` - readlink_canonicalise "$1" - fi - fi -} +shsh_junest_pkg_name=_bootstrap/junest +real_junest_bin="$SHSH_ROOT/cellar/packages/$shsh_junest_pkg_name/bin/junest" -bin_path="$(dirname "$(resolve_link "$0")")" -# shellcheck source=libexec/shsh-_env-var -. "$bin_path/shsh-_env-var" +if [ "$(basename "$0")" = junest ]; then + # wrapper mode + exec "$real_junest_bin" "$@" + exit +fi # shellcheck source=libexec/shsh-_utils . "${UTILS_FUNC:?}" -set -e - -export JUNEST_HOME="$SHSH_JUNEST_ROOT/junest" -junest_bin_root="$JUNEST_HOME/usr/bin_wrappers" +# TAG completions +if [ "$1" = "--complete" ]; then + printf '%s\n' link unlink linked linkable lookup packages enter + exit +fi ########################################################## # bootstrap +if [ ! -e "$SHSH_INSTALL_BIN/junest" ] && [ -e "$SHSH_ROOT/libexec/shsh-junest" ]; then + ln -s "$SHSH_ROOT/libexec/shsh-junest" "$SHSH_INSTALL_BIN/junest" +fi if ! command_exists junest_real || [ ! -d "$JUNEST_HOME" ]; then prompt "> Junest not found. Install now?" || exit - shsh install fsquillace/junest _bootstrap/junest -v BINS=bin/junest@junest_real:bin/sudoj@sudoj -f + shsh install fsquillace/junest "$shsh_junest_pkg_name" -v BINS=bin/junest@junest_real -f junest_real setup @@ -59,29 +56,25 @@ if ! command_exists junest_real || [ ! -d "$JUNEST_HOME" ]; then exit 1 fi mkdir -p "$SHSH_JUNEST_BIN" + shsh junest link yay fi -[ ! -e "$SHSH_JUNEST_BIN/junest" ] && ln -s "$SHSH_ROOT/libexec/shsh-junest" "$SHSH_JUNEST_BIN/junest" ########################################################## - - -set -e - is_exectuable_file () { [ -f "$1" ] && [ -x "$1" ] } list_all_packages_and_executables () { - "$(shsh package-path _bootstrap/junest)/bin/junest" -- pacman -Ql | grep ' /usr/bin/' | while read -r package file; do - if is_exectuable_file "$file"; then + "$real_junest_bin" -- pacman -Ql | grep ' /usr/bin/' | while read -r package file; do + if is_exectuable_file "$JUNEST_HOME/$file"; then printf '%s\t%s\n' "${file##*/}" "pkg: $package" fi done } list_all_packages () { - "$(shsh package-path _bootstrap/junest)/bin/junest" -- pacman -Q | while read -r package version; do + "$real_junest_bin" -- pacman -Q | while read -r package version; do if [ -n "$OPT_DETAILS" ]; then printf '%s\t%s\n' "$package" "$version" else @@ -91,13 +84,13 @@ list_all_packages () { } get_package_executables () { - "$(shsh package-path _bootstrap/junest)/bin/junest" -- pacman -Qql "$1" | while read -r file; do + "$real_junest_bin" -- pacman -Qql "$1" | while read -r file; do is_exectuable_file "$file" && echo "$file" done } get_package_name_from_file () { - "$(shsh package-path _bootstrap/junest)/bin/junest" -- pacman -Qo "$1" + "$real_junest_bin" -- pacman -Qo "$1" } show_help_and_exit () { @@ -105,6 +98,15 @@ show_help_and_exit () { exit 1 } +# super case +case "$1" in + enter) + shift + exec "$real_junest_bin" "$@" + exit + ;; +esac + # process flag # shellcheck disable=SC2116,SC2028 @@ -153,7 +155,9 @@ if [ "$#" != 0 ]; then if [ -n "$OPT_DETAILS" ]; then list_all_packages_and_executables else - command ls "$junest_bin_root" + for file in "$junest_bin_root"/*; do + is_file_or_link "$file" && echo "${file##*/}" + done fi else show_help_and_exit @@ -163,7 +167,6 @@ if [ "$#" != 0 ]; then linked) [ "$#" = 1 ] || show_help_and_exit linked_bins="$(command ls "$SHSH_JUNEST_BIN")" - linked_bins="$(echo "$linked_bins" | tr '\n' ' ')" if [ -n "$OPT_DETAILS" ]; then # FIXME The following might be very slow, it's O(mn) complexity diff --git a/man/man1/shsh-cleanup.1 b/man/man1/shsh-cleanup.1 index cf55959..9f4e041 100644 --- a/man/man1/shsh-cleanup.1 +++ b/man/man1/shsh-cleanup.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B shsh \fI\,cleanup \/\fR[\fI\,-d|--dry\/\fR] @@ -32,6 +32,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), diff --git a/man/man1/shsh-commands.1 b/man/man1/shsh-commands.1 index 5a08eed..7dfc999 100644 --- a/man/man1/shsh-commands.1 +++ b/man/man1/shsh-commands.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B shsh \fI\,commands\/\fR @@ -28,6 +28,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), diff --git a/man/man1/shsh-completions.1 b/man/man1/shsh-completions.1 index ebd05f6..0952759 100644 --- a/man/man1/shsh-completions.1 +++ b/man/man1/shsh-completions.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B shsh \fI\,completions \/\fR @@ -27,6 +27,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), diff --git a/man/man1/shsh-edit.1 b/man/man1/shsh-edit.1 index 95518a8..5f82cde 100644 --- a/man/man1/shsh-edit.1 +++ b/man/man1/shsh-edit.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B shsh \fI\,edit\/\fR @@ -26,6 +26,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), diff --git a/man/man1/shsh-get.1 b/man/man1/shsh-get.1 index a8beb37..a9c1448 100644 --- a/man/man1/shsh-get.1 +++ b/man/man1/shsh-get.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B shsh \fI\,get \/\fR @@ -26,6 +26,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), diff --git a/man/man1/shsh-help.1 b/man/man1/shsh-help.1 index 0437766..0e32133 100644 --- a/man/man1/shsh-help.1 +++ b/man/man1/shsh-help.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B shsh \fI\,help \/\fR[\fI\,--usage\/\fR] \fI\,COMMAND\/\fR @@ -32,6 +32,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), diff --git a/man/man1/shsh-init.1 b/man/man1/shsh-init.1 index b58f388..baa69c3 100644 --- a/man/man1/shsh-init.1 +++ b/man/man1/shsh-init.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B eval \fI\,"$(shsh init SHELL)"\/\fR @@ -26,6 +26,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), diff --git a/man/man1/shsh-install.1 b/man/man1/shsh-install.1 index 3ad7e28..d72c92b 100644 --- a/man/man1/shsh-install.1 +++ b/man/man1/shsh-install.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B shsh \fI\,install \/\fR[\fI\,site\/\fR]\fI\,/\/\fR[\fI\,@ref\/\fR] [\fI\,/\/\fR] @@ -73,44 +73,36 @@ multiples are given, they will be run in sequential order. a+x Before linking, add executable bit to all files. .SH EXAMPLES -.IP +.TP shsh install soraxas/dot\-reminder -.IP install 'soraxas/dot\-reminder' as a package -.IP +.TP shsh install soraxas/git\-utils git/tools -.IP install 'soraxas/git\-utils' to a folder within 'git/tools' -.IP +.TP shsh install \-\-ssh -.IP install with ssh protocal (rather than https) -.IP +.TP shsh install \-v FISH_COMPLETIONS=synoservice.fish:forgit.fish -.IP link 'synoservice.fish' and 'forgit.fish' as fish completion files -.IP +.TP shsh install \-\-hook pre="mv bin/foo bin/bar" -.IP Execute the script "mv bin/foo bin/bar" before `shsh` performs linking (e.g. this script renames the binary) -.IP +.TP shsh install \-\-hook +x=foobar -.IP add a hook that add executable bits to the file 'foobar', before linking is performed -.IP +.TP shsh install \-h pre='make all' \-h post='rm \-r build/*' -.IP add a hook that runs 'make all' to build binaries, right after cloning and before linking is performed. Then, linking is performed with its usual rules (i.e. all executable files in root and in bin/). Finally, \&'rm \-r build/*' is ran to remove leftovers. -.IP +.TP shsh install \-\-plain wsl\-tools/win32yank \-h pre='curl \-sLo out.zip \e -.IP https://<..>/releases/<..>.zip && unzip out.zip' \-h +x=win32yank.exe .IP add a plain package by using curl to download pre\-built @@ -132,6 +124,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), diff --git a/man/man1/shsh-junest.1 b/man/man1/shsh-junest.1 new file mode 100644 index 0000000..c8c47c7 --- /dev/null +++ b/man/man1/shsh-junest.1 @@ -0,0 +1,47 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.SH NAME +shsh \- manual page for shsh v3.0.0 +.SH SYNOPSIS +.B shsh +\fI\,junest \/\fR[\fI\,-h|--help\/\fR] \fI\,\/\fR +.SH DESCRIPTION +A transparently wrapper of junest with custom ignoring bins +.IP +shsh junest enter [argunments for junest...] +shsh junest link +shsh junest unlink +shsh junest linkable [package] [\-d|\-\-details] +shsh junest linked [\-d|\-\-details] +shsh junest packages [\-d|\-\-details] +shsh junest lookup +.PP +This can automatically bootstrap junest, which brings a lot of +packages from the arch linux community AUR via yay. +After bootstrapping, you can directly install packages via yay. +.SH AUTHOR +Written by Tin Lai (@soraxas) +.SH COPYRIGHT +Copyright \(co 2014 Juan Ibiapina, 2020 Tin Lai (@soraxas) +.br +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +.SH "SEE ALSO" +.B shsh (1), +.B shsh-cleanup (1), +.B shsh-commands (1), +.B shsh-completions (1), +.B shsh-edit (1), +.B shsh-get (1), +.B shsh-help (1), +.B shsh-init (1), +.B shsh-install (1), +.B shsh-junest (1), +.B shsh-link (1), +.B shsh-list (1), +.B shsh-outdated (1), +.B shsh-package-path (1), +.B shsh-refresh (1), +.B shsh-self-upgrade (1), +.B shsh-uninstall (1), +.B shsh-upgrade (1) diff --git a/man/man1/shsh-link.1 b/man/man1/shsh-link.1 index 41aabc2..5dc34bc 100644 --- a/man/man1/shsh-link.1 +++ b/man/man1/shsh-link.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B shsh \fI\,link \/\fR[\fI\,--no-deps\/\fR] \fI\, \/\fR[\fI\,-h|--hook \/\fR] [\fI\,-v|--variable =\/\fR] @@ -26,6 +26,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), diff --git a/man/man1/shsh-list.1 b/man/man1/shsh-list.1 index e9792d9..22c0840 100644 --- a/man/man1/shsh-list.1 +++ b/man/man1/shsh-list.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B shsh \fI\,list \/\fR[\fI\,-d|--details\/\fR] @@ -28,6 +28,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), diff --git a/man/man1/shsh-outdated.1 b/man/man1/shsh-outdated.1 index 5559b79..57751e7 100644 --- a/man/man1/shsh-outdated.1 +++ b/man/man1/shsh-outdated.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B shsh \fI\,outdated \/\fR[\fI\,-q|--quiet\/\fR] @@ -26,6 +26,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), diff --git a/man/man1/shsh-package-path.1 b/man/man1/shsh-package-path.1 index c3be616..08ce1b7 100644 --- a/man/man1/shsh-package-path.1 +++ b/man/man1/shsh-package-path.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B source \fI\,"$(shsh package-path )/file.sh"\/\fR @@ -26,6 +26,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), diff --git a/man/man1/shsh-refresh.1 b/man/man1/shsh-refresh.1 index ae724df..91f2ba6 100644 --- a/man/man1/shsh-refresh.1 +++ b/man/man1/shsh-refresh.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B shsh \fI\,refresh \/\fR[\fI\,--verbose\/\fR] [\fI\,-a|--all\/\fR] @@ -26,6 +26,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), diff --git a/man/man1/shsh-self-upgrade.1 b/man/man1/shsh-self-upgrade.1 index 637e5f0..73257c5 100644 --- a/man/man1/shsh-self-upgrade.1 +++ b/man/man1/shsh-self-upgrade.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B shsh \fI\,self-upgrade\/\fR @@ -26,6 +26,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), diff --git a/man/man1/shsh-uninstall.1 b/man/man1/shsh-uninstall.1 index fb99f16..d0cf441 100644 --- a/man/man1/shsh-uninstall.1 +++ b/man/man1/shsh-uninstall.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B shsh \fI\,uninstall \/\fR @@ -34,6 +34,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), diff --git a/man/man1/shsh-upgrade.1 b/man/man1/shsh-upgrade.1 index 1ff8149..1078047 100644 --- a/man/man1/shsh-upgrade.1 +++ b/man/man1/shsh-upgrade.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B shsh \fI\,upgrade \/\fR[\fI\,-f|--force\/\fR] @@ -39,6 +39,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), diff --git a/man/man1/shsh.1 b/man/man1/shsh.1 index e4506a3..8b24b06 100644 --- a/man/man1/shsh.1 +++ b/man/man1/shsh.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "April 2023" "shell script handler v2.8.2" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" .SH NAME -shsh \- manual page for shsh v2.8.2 +shsh \- manual page for shsh v3.0.0 .SH SYNOPSIS .B shsh \fI\, \/\fR[\fI\,\/\fR] [\fI\,--verbose\/\fR] [\fI\,--help\/\fR] @@ -33,6 +33,9 @@ Configure the shell environment for shsh install Installs a package from github, custom site, or any arbitrary recipes. .TP +junest +A transparently wrapper of junest with custom ignoring bins +.TP link Installs a local directory as a shsh package .TP @@ -203,48 +206,57 @@ multiples are given, they will be run in sequential order. a+x Before linking, add executable bit to all files. .SS EXAMPLES -.IP +.TP shsh install soraxas/dot\-reminder -.IP install 'soraxas/dot\-reminder' as a package -.IP +.TP shsh install soraxas/git\-utils git/tools -.IP install 'soraxas/git\-utils' to a folder within 'git/tools' -.IP +.TP shsh install \-\-ssh -.IP install with ssh protocal (rather than https) -.IP +.TP shsh install \-v FISH_COMPLETIONS=synoservice.fish:forgit.fish -.IP link 'synoservice.fish' and 'forgit.fish' as fish completion files -.IP +.TP shsh install \-\-hook pre="mv bin/foo bin/bar" -.IP Execute the script "mv bin/foo bin/bar" before `shsh` performs linking (e.g. this script renames the binary) -.IP +.TP shsh install \-\-hook +x=foobar -.IP add a hook that add executable bits to the file 'foobar', before linking is performed -.IP +.TP shsh install \-h pre='make all' \-h post='rm \-r build/*' -.IP add a hook that runs 'make all' to build binaries, right after cloning and before linking is performed. Then, linking is performed with its usual rules (i.e. all executable files in root and in bin/). Finally, \&'rm \-r build/*' is ran to remove leftovers. -.IP +.TP shsh install \-\-plain wsl\-tools/win32yank \-h pre='curl \-sLo out.zip \e -.IP https://<..>/releases/<..>.zip && unzip out.zip' \-h +x=win32yank.exe .IP add a plain package by using curl to download pre\-built binary from upstream release page. +.SH "SUBCMD: SHSH JUNEST" +.B shsh +\fI\,junest \/\fR[\fI\,-h|--help\/\fR] \fI\,\/\fR +.SS DESCRIPTION +A transparently wrapper of junest with custom ignoring bins +.IP +shsh junest enter [argunments for junest...] +shsh junest link +shsh junest unlink +shsh junest linkable [package] [\-d|\-\-details] +shsh junest linked [\-d|\-\-details] +shsh junest packages [\-d|\-\-details] +shsh junest lookup +.PP +This can automatically bootstrap junest, which brings a lot of +packages from the arch linux community AUR via yay. +After bootstrapping, you can directly install packages via yay. .SH "SUBCMD: SHSH LINK" .B shsh \fI\,link \/\fR[\fI\,--no-deps\/\fR] \fI\, \/\fR[\fI\,-h|--hook \/\fR] [\fI\,-v|--variable =\/\fR] @@ -424,6 +436,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .B shsh-help (1), .B shsh-init (1), .B shsh-install (1), +.B shsh-junest (1), .B shsh-link (1), .B shsh-list (1), .B shsh-outdated (1), From 928d96a14e82c372d387fdbf844b306796cc8366 Mon Sep 17 00:00:00 2001 From: Tin Lai Date: Thu, 25 May 2023 19:48:22 +1000 Subject: [PATCH 2/9] remove legacy archpkg operations Signed-off-by: Tin Lai --- completions/shsh.fish | 1 - libexec/shsh | 2 +- libexec/shsh-_env-var | 3 +-- libexec/shsh-_utils | 23 ----------------------- libexec/shsh-install | 26 ++------------------------ libexec/shsh-list | 2 -- libexec/shsh-uninstall | 1 - man/man1/shsh-cleanup.1 | 4 ++-- man/man1/shsh-commands.1 | 4 ++-- man/man1/shsh-completions.1 | 4 ++-- man/man1/shsh-edit.1 | 4 ++-- man/man1/shsh-get.1 | 4 ++-- man/man1/shsh-help.1 | 4 ++-- man/man1/shsh-init.1 | 4 ++-- man/man1/shsh-install.1 | 6 ++---- man/man1/shsh-junest.1 | 4 ++-- man/man1/shsh-link.1 | 4 ++-- man/man1/shsh-list.1 | 4 ++-- man/man1/shsh-outdated.1 | 4 ++-- man/man1/shsh-package-path.1 | 4 ++-- man/man1/shsh-refresh.1 | 4 ++-- man/man1/shsh-self-upgrade.1 | 4 ++-- man/man1/shsh-uninstall.1 | 4 ++-- man/man1/shsh-upgrade.1 | 4 ++-- man/man1/shsh.1 | 6 ++---- 25 files changed, 40 insertions(+), 94 deletions(-) diff --git a/completions/shsh.fish b/completions/shsh.fish index 991c595..785c196 100644 --- a/completions/shsh.fish +++ b/completions/shsh.fish @@ -73,7 +73,6 @@ complete -f -c shsh -n "__fish_shsh_using_command install" -l noconfirm -d "do n complete -f -c shsh -n "__fish_shsh_using_command install" -l ssh -d "use ssh protocal instead of https" complete -f -c shsh -n "__fish_shsh_using_command install" -l plain -d "build a plain package from the ground up" complete -f -c shsh -n "__fish_shsh_using_command install" -l gh-release -d "download binary from github release assets" -complete -f -c shsh -n "__fish_shsh_using_command install" -l archpkg -d "install the package as an Arch/AUR package" complete -f -c shsh -n "__fish_shsh_using_command uninstall" -l quiet -d "be quiet even if package does not exists" complete -f -c shsh -n "__fish_shsh_using_command uninstall" -l use-rc -d "uninstall all packages not present in SHSHRC" diff --git a/libexec/shsh b/libexec/shsh index b945657..f44f80c 100755 --- a/libexec/shsh +++ b/libexec/shsh @@ -116,7 +116,7 @@ for arg; do ;; --version) cat << EOF -shsh (shell script handler) v3.0.0 +shsh (shell script handler) v3.0.1 Copyright (c) 2014 Juan Ibiapina, 2020 Tin Lai (@soraxas) This is free software; see the source for copying conditions. There is NO diff --git a/libexec/shsh-_env-var b/libexec/shsh-_env-var index c24de08..ce0151f 100644 --- a/libexec/shsh-_env-var +++ b/libexec/shsh-_env-var @@ -38,7 +38,6 @@ export SHSH_PREFIX="${SHSH_PREFIX:=$SHSH_ROOT/cellar}" export SHSH_PACKAGES_PATH="${SHSH_PACKAGES_PATH:=$SHSH_PREFIX/packages}" export SHSH_INSTALL_BIN="${SHSH_INSTALL_BIN:=$SHSH_PREFIX/bin}" export SHSH_INSTALL_MAN="${SHSH_INSTALL_MAN:=$SHSH_PREFIX/man}" -export SHSH_INSTALL_ARCHPKG_ROOT="${SHSH_INSTALL_ARCHPKG_ROOT:=$SHSH_ROOT/cellar/archpkg_root}" _xdg_config_home="${XDG_CONFIG_HOME:=$HOME/.config}" export SHSHRC="${SHSHRC:=$_xdg_config_home/shshrc}" @@ -47,4 +46,4 @@ export PATH="${bin_path}:${PATH}" export UTILS_FUNC="$bin_path/shsh-_utils" export SHSH_JUNEST_ROOT="$SHSH_ROOT/cellar/arch_junest_root" -export SHSH_JUNEST_BIN="$SHSH_JUNEST_ROOT/junest_bin" \ No newline at end of file +export SHSH_JUNEST_BIN="$SHSH_JUNEST_ROOT/junest_bin" diff --git a/libexec/shsh-_utils b/libexec/shsh-_utils index 7f4f3d4..3f77ee2 100755 --- a/libexec/shsh-_utils +++ b/libexec/shsh-_utils @@ -340,14 +340,9 @@ EOF # fi _folder_namespace="$1" _folder_target="$1" - [ "$operation" = "archpkg" ] && _folder_namespace="_archpkg" info_echo "> Going to use '$_folder_namespace/$_folder_target' as the install folder" ;; esac - if [ -n "$operation" ] && [ "$operation" != "archpkg" ] && [ "$_folder_namespace" = "_archpkg" ]; then - error_echo "> The '_archpkg' namespace is reserved and cannot be used." - exit 1 - fi _folder_full="$_folder_namespace/$_folder_target" export _folder_namespace export _folder_target @@ -401,24 +396,6 @@ if ! command_exists jq; then } fi -get_archlinux_makepkg() { - _makepkg_path="$(shsh package-path _bootstrap/archmakepkg)" || true - - if [ -z "$_makepkg_path" ]; then - # bootstrap custom makepkg - info_echo "> Installing custom arch makepkg" - - # no linking - shsh install soraxas/archlinux-makepkg-stripped _bootstrap/archmakepkg -v BINS='' >/dev/null 2>&1 - _makepkg_path="$(shsh package-path _bootstrap/archmakepkg)" || true - if [ -z "$_makepkg_path" ]; then - error_echo "> error in bootstrapping makepkg" - exit 1 - fi - fi - echo "$_makepkg_path/makepkg" -} - parse_hooks_and_setvar() { echo_if_verbose ">> parsing install command: '$*'" # shellcheck disable=SC2116,SC2028 diff --git a/libexec/shsh-install b/libexec/shsh-install index 9ee42eb..b799252 100755 --- a/libexec/shsh-install +++ b/libexec/shsh-install @@ -24,7 +24,6 @@ # flag implies --plain # TODO: currently it is bias towards linux and amd64; # to-be generalised towards detecting current arch. -# --arch[pkg] install the as Arch package (or AUR) # -f, --force force the installation even if the package exists # --ssh use ssh protocal instead of https # @@ -90,17 +89,10 @@ if [ "$#" != 0 ]; then --ssh) use_ssh="true" ;; - --arch|--archpkg) - archpkg="true" - ;; --nocleanup) no_cleanup="true" export no_cleanup ;; - --noconfirm) - SHSH_ARCHPKG_NOCONFIRM="true" - export SHSH_ARCHPKG_NOCONFIRM - ;; -f|--force) force_install="true" ;; @@ -146,10 +138,6 @@ fi ############################################################ -if [ -n "$2" ] && [ -n "$archpkg" ]; then - error_echo "> Arch/AUR package cannot use custom folder name." - exit 1 -fi # custom folder name parse_install_folder "$2" "$operation" && package="$_folder_full" @@ -158,15 +146,13 @@ parse_install_folder "$2" "$operation" && package="$_folder_full" ########################################## if [ -n "$plain_package" ]; then operation="plain" -elif [ -n "$archpkg" ]; then - operation="archpkg" else operation="gitclone" fi case "$operation" in ######### - plain|archpkg) + plain) if [ -z "$package" ]; then # extract ref if it exists ref="" @@ -255,10 +241,6 @@ case "$operation" in # plain package or github-release mkdir -p "${SHSH_PACKAGES_PATH}/$package" ;; - archpkg) - mkdir -p "${SHSH_PACKAGES_PATH}/$package" - shsh-_install-archpkg "$1" "$package" - ;; gitclone) # only perform link if clone is successful (and package not exists before) if ! shsh-_clone "$use_ssh" "$site" "$gitrepo" "$ref" "$package"; then @@ -284,11 +266,7 @@ fi # add successfully installed package to shshrc if [ -e "$SHSHRC" ]; then set +e # allow non-zero exit status in pattern matching - if [ "$operation" = "archpkg" ]; then - _target_package="$1" - else - _target_package="$package" - fi + _target_package="$package" shshrc_get_existing_install_cmd "$_target_package" new_statement="shsh install $original_args" diff --git a/libexec/shsh-list b/libexec/shsh-list index 1e97664..262c129 100755 --- a/libexec/shsh-list +++ b/libexec/shsh-list @@ -44,8 +44,6 @@ for package_path in "${SHSH_PACKAGES_PATH}"/*/*; do else extra_info="gh-release: unknown (missing jq)" fi - elif [ "$username" = "_archpkg" ]; then - extra_info="Arch-package: $package" else # is a plain package extra_info="plain package" diff --git a/libexec/shsh-uninstall b/libexec/shsh-uninstall index adf9c38..ec671c5 100755 --- a/libexec/shsh-uninstall +++ b/libexec/shsh-uninstall @@ -78,7 +78,6 @@ fi shsh-_unlink-man "$package" shsh-_unlink-bins "$package" shsh-_unlink-completions "$package" -shsh-_unlink-archpkg "$package" [ -n "$SHSH_HOOK_UNINSTALL" ] && execute_hooks "uninstall-hook" "$SHSH_PACKAGES_PATH/$package" "$SHSH_HOOK_UNINSTALL" rm -rf "${SHSH_PACKAGES_PATH:?}/$package" diff --git a/man/man1/shsh-cleanup.1 b/man/man1/shsh-cleanup.1 index 9f4e041..ac3dc12 100644 --- a/man/man1/shsh-cleanup.1 +++ b/man/man1/shsh-cleanup.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B shsh \fI\,cleanup \/\fR[\fI\,-d|--dry\/\fR] diff --git a/man/man1/shsh-commands.1 b/man/man1/shsh-commands.1 index 7dfc999..5f72c4d 100644 --- a/man/man1/shsh-commands.1 +++ b/man/man1/shsh-commands.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B shsh \fI\,commands\/\fR diff --git a/man/man1/shsh-completions.1 b/man/man1/shsh-completions.1 index 0952759..bbe0b9e 100644 --- a/man/man1/shsh-completions.1 +++ b/man/man1/shsh-completions.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B shsh \fI\,completions \/\fR diff --git a/man/man1/shsh-edit.1 b/man/man1/shsh-edit.1 index 5f82cde..3f1048c 100644 --- a/man/man1/shsh-edit.1 +++ b/man/man1/shsh-edit.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B shsh \fI\,edit\/\fR diff --git a/man/man1/shsh-get.1 b/man/man1/shsh-get.1 index a9c1448..b9a7103 100644 --- a/man/man1/shsh-get.1 +++ b/man/man1/shsh-get.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B shsh \fI\,get \/\fR diff --git a/man/man1/shsh-help.1 b/man/man1/shsh-help.1 index 0e32133..1a5cfcc 100644 --- a/man/man1/shsh-help.1 +++ b/man/man1/shsh-help.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B shsh \fI\,help \/\fR[\fI\,--usage\/\fR] \fI\,COMMAND\/\fR diff --git a/man/man1/shsh-init.1 b/man/man1/shsh-init.1 index baa69c3..b6c2872 100644 --- a/man/man1/shsh-init.1 +++ b/man/man1/shsh-init.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B eval \fI\,"$(shsh init SHELL)"\/\fR diff --git a/man/man1/shsh-install.1 b/man/man1/shsh-install.1 index d72c92b..749d87e 100644 --- a/man/man1/shsh-install.1 +++ b/man/man1/shsh-install.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B shsh \fI\,install \/\fR[\fI\,site\/\fR]\fI\,/\/\fR[\fI\,@ref\/\fR] [\fI\,/\/\fR] @@ -42,8 +42,6 @@ flag implies \fB\-\-plain\fR TODO: currently it is bias towards linux and amd64; .IP to\-be generalised towards detecting current arch. -.HP -\fB\-\-arch[pkg]\fR install the as Arch package (or AUR) .TP \fB\-f\fR, \fB\-\-force\fR force the installation even if the package exists diff --git a/man/man1/shsh-junest.1 b/man/man1/shsh-junest.1 index c8c47c7..580064c 100644 --- a/man/man1/shsh-junest.1 +++ b/man/man1/shsh-junest.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B shsh \fI\,junest \/\fR[\fI\,-h|--help\/\fR] \fI\,\/\fR diff --git a/man/man1/shsh-link.1 b/man/man1/shsh-link.1 index 5dc34bc..6236011 100644 --- a/man/man1/shsh-link.1 +++ b/man/man1/shsh-link.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B shsh \fI\,link \/\fR[\fI\,--no-deps\/\fR] \fI\, \/\fR[\fI\,-h|--hook \/\fR] [\fI\,-v|--variable =\/\fR] diff --git a/man/man1/shsh-list.1 b/man/man1/shsh-list.1 index 22c0840..8b6ba9f 100644 --- a/man/man1/shsh-list.1 +++ b/man/man1/shsh-list.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B shsh \fI\,list \/\fR[\fI\,-d|--details\/\fR] diff --git a/man/man1/shsh-outdated.1 b/man/man1/shsh-outdated.1 index 57751e7..e67e1aa 100644 --- a/man/man1/shsh-outdated.1 +++ b/man/man1/shsh-outdated.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B shsh \fI\,outdated \/\fR[\fI\,-q|--quiet\/\fR] diff --git a/man/man1/shsh-package-path.1 b/man/man1/shsh-package-path.1 index 08ce1b7..dfb4592 100644 --- a/man/man1/shsh-package-path.1 +++ b/man/man1/shsh-package-path.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B source \fI\,"$(shsh package-path )/file.sh"\/\fR diff --git a/man/man1/shsh-refresh.1 b/man/man1/shsh-refresh.1 index 91f2ba6..9d1492f 100644 --- a/man/man1/shsh-refresh.1 +++ b/man/man1/shsh-refresh.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B shsh \fI\,refresh \/\fR[\fI\,--verbose\/\fR] [\fI\,-a|--all\/\fR] diff --git a/man/man1/shsh-self-upgrade.1 b/man/man1/shsh-self-upgrade.1 index 73257c5..8b2a528 100644 --- a/man/man1/shsh-self-upgrade.1 +++ b/man/man1/shsh-self-upgrade.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B shsh \fI\,self-upgrade\/\fR diff --git a/man/man1/shsh-uninstall.1 b/man/man1/shsh-uninstall.1 index d0cf441..9d493b4 100644 --- a/man/man1/shsh-uninstall.1 +++ b/man/man1/shsh-uninstall.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B shsh \fI\,uninstall \/\fR diff --git a/man/man1/shsh-upgrade.1 b/man/man1/shsh-upgrade.1 index 1078047..6a62ac4 100644 --- a/man/man1/shsh-upgrade.1 +++ b/man/man1/shsh-upgrade.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B shsh \fI\,upgrade \/\fR[\fI\,-f|--force\/\fR] diff --git a/man/man1/shsh.1 b/man/man1/shsh.1 index 8b24b06..e09f1de 100644 --- a/man/man1/shsh.1 +++ b/man/man1/shsh.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.0" "User Commands" +.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.0 +shsh \- manual page for shsh v3.0.1 .SH SYNOPSIS .B shsh \fI\, \/\fR[\fI\,\/\fR] [\fI\,--verbose\/\fR] [\fI\,--help\/\fR] @@ -175,8 +175,6 @@ flag implies \fB\-\-plain\fR TODO: currently it is bias towards linux and amd64; .IP to\-be generalised towards detecting current arch. -.HP -\fB\-\-arch[pkg]\fR install the as Arch package (or AUR) .TP \fB\-f\fR, \fB\-\-force\fR force the installation even if the package exists From 364a9bdfc535f44342d7007d29725e64bf15c7c5 Mon Sep 17 00:00:00 2001 From: Tin Lai Date: Thu, 24 Aug 2023 10:16:12 +1000 Subject: [PATCH 3/9] add filter Signed-off-by: Tin Lai --- libexec/shsh-_post-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/shsh-_post-install b/libexec/shsh-_post-install index e02bda0..7198952 100755 --- a/libexec/shsh-_post-install +++ b/libexec/shsh-_post-install @@ -74,7 +74,7 @@ if [ -n "$gh_release" ]; then # archives available_assets="$(filter_by_preference "$available_assets" 'map(select(.name|test("(.tgz)|(.tar.gz)|(.zip)|(.xz)$")))')" # prefer statically linked assets - available_assets="$(filter_by_preference "$available_assets" 'map(select(.name|test("(linux-musl)|(linux)")))')" + available_assets="$(filter_by_preference "$available_assets" 'map(select(.name|test("(linux-musl)|(linux)|(Linux)")))')" # get first item item="$(echo "$available_assets" | jq -r '.[0]')" From d962c2ad5b72e3a05ed558ad89fedb3b0f9f7a3e Mon Sep 17 00:00:00 2001 From: Tin Lai Date: Thu, 24 Aug 2023 10:18:03 +1000 Subject: [PATCH 4/9] more verbose and fix script exiting due to not using return Signed-off-by: Tin Lai --- libexec/shsh-_post-install | 4 +++- libexec/shsh-_utils | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libexec/shsh-_post-install b/libexec/shsh-_post-install index 7198952..89db950 100755 --- a/libexec/shsh-_post-install +++ b/libexec/shsh-_post-install @@ -14,6 +14,7 @@ ref="$4" # script for gh release if [ -n "$gh_release" ]; then + echo_if_verbose ">> Requesting github release info" _response="$(request_gh_release_info "$package" "$ref")" if [ "$(jq -r -n --argjson data "$_response" '$data.message')" = "Not Found" ]; then @@ -21,10 +22,11 @@ if [ -n "$gh_release" ]; then exit 1 fi - # save the release tag to file + echo_if_verbose ">> Saving release tag to file" jq -n --argjson data "$_response" '$data' > "$target_folder/.gh-release_info" # using EOF method as the original json might contain invalid characters + echo_if_verbose ">> Parsing json result" all_available_assets="$(jq -n --argjson data "$_response" '$data.assets')" available_assets="$all_available_assets" diff --git a/libexec/shsh-_utils b/libexec/shsh-_utils index 3f77ee2..096312a 100755 --- a/libexec/shsh-_utils +++ b/libexec/shsh-_utils @@ -392,7 +392,7 @@ if ! command_exists jq; then fi "$SHSH_PACKAGES_PATH/_bootstrap/jq/$bin_name" "$@" - exit $? + return $? } fi From 68931236853e7b6e893cb5533a9688500342fbe4 Mon Sep 17 00:00:00 2001 From: Tin Lai Date: Thu, 24 Aug 2023 10:24:29 +1000 Subject: [PATCH 5/9] fix test Signed-off-by: Tin Lai --- tests/shsh-init.bats | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/tests/shsh-init.bats b/tests/shsh-init.bats index ddf9cfe..2ef0d10 100644 --- a/tests/shsh-init.bats +++ b/tests/shsh-init.bats @@ -11,41 +11,48 @@ load test_helper @test "exports SHSH_ROOT" { SHSH_ROOT=/lol run shsh-init bash assert_success - assert_line -n 0 'export SHSH_ROOT=/lol' + assert_line -n 0 'export SHSH_ROOT="/lol"' } @test "exports SHSH_PREFIX" { SHSH_PREFIX=/lol run shsh-init bash assert_success - assert_line -n 1 'export SHSH_PREFIX=/lol' + assert_line -n 1 'export SHSH_PREFIX="/lol"' } @test "exports SHSH_PACKAGES_PATH" { SHSH_PACKAGES_PATH=/lol/packages run shsh-init bash assert_success - assert_line -n 2 'export SHSH_PACKAGES_PATH=/lol/packages' + assert_line -n 2 'export SHSH_PACKAGES_PATH="/lol/packages"' } -@test "adds cellar/bin to path" { +@test "adds junest to path" { run shsh-init bash assert_success - assert_line -n 3 'export PATH="$SHSH_ROOT/cellar/bin:$PATH"' + assert_line -n 3 'export SHSH_JUNEST_BIN="/home/tin/.local/share/shsh/cellar/arch_junest_root/junest_bin"' + assert_line -n 4 'export PATH="$PATH:$SHSH_JUNEST_BIN"' } -@test "setup include function if it exists" { +@test "adds cellar/bin to path" { run shsh-init bash - assert_line -n 4 '. "$SHSH_ROOT/lib/include.bash"' + assert_success + assert_line -n 5 'export PATH="$SHSH_ROOT/cellar/bin:$PATH"' } -@test "doesn't setup include function if it doesn't exist" { - run shsh-init fakesh - refute_line 'source "$SHSH_ROOT/lib/include.fakesh"' +@test "setup include function if it exists" { + run shsh-init bash + assert_line -n 6 '. "$SHSH_ROOT/lib/include.bash"' } @test "setup shsh completions if available" { run shsh-init bash assert_success - assert_line -n 5 '. "$SHSH_ROOT/completions/shsh.bash"' + assert_line -n 7 '. "$SHSH_ROOT/completions/shsh.bash"' +} + +@test "doesn't setup include function if it doesn't exist" { + run shsh-init fakesh + refute_line 'source "$SHSH_ROOT/lib/include.fakesh"' } @test "does not setup shsh completions if not available" { From cee72957bce562d7b9691013a1b9c68426d9c8ad Mon Sep 17 00:00:00 2001 From: Tin Lai Date: Thu, 24 Aug 2023 10:26:34 +1000 Subject: [PATCH 6/9] fix shell check and bump version for bug fix Signed-off-by: Tin Lai --- libexec/shsh | 2 +- libexec/shsh-_utils | 2 +- man/man1/shsh-cleanup.1 | 4 ++-- man/man1/shsh-commands.1 | 4 ++-- man/man1/shsh-completions.1 | 4 ++-- man/man1/shsh-edit.1 | 4 ++-- man/man1/shsh-get.1 | 4 ++-- man/man1/shsh-help.1 | 4 ++-- man/man1/shsh-init.1 | 4 ++-- man/man1/shsh-install.1 | 4 ++-- man/man1/shsh-junest.1 | 4 ++-- man/man1/shsh-link.1 | 4 ++-- man/man1/shsh-list.1 | 4 ++-- man/man1/shsh-outdated.1 | 4 ++-- man/man1/shsh-package-path.1 | 4 ++-- man/man1/shsh-refresh.1 | 4 ++-- man/man1/shsh-self-upgrade.1 | 4 ++-- man/man1/shsh-uninstall.1 | 4 ++-- man/man1/shsh-upgrade.1 | 4 ++-- man/man1/shsh.1 | 4 ++-- 20 files changed, 38 insertions(+), 38 deletions(-) diff --git a/libexec/shsh b/libexec/shsh index f44f80c..3e31da7 100755 --- a/libexec/shsh +++ b/libexec/shsh @@ -116,7 +116,7 @@ for arg; do ;; --version) cat << EOF -shsh (shell script handler) v3.0.1 +shsh (shell script handler) v3.0.2 Copyright (c) 2014 Juan Ibiapina, 2020 Tin Lai (@soraxas) This is free software; see the source for copying conditions. There is NO diff --git a/libexec/shsh-_utils b/libexec/shsh-_utils index 096312a..912fc54 100755 --- a/libexec/shsh-_utils +++ b/libexec/shsh-_utils @@ -305,7 +305,7 @@ parse_install_folder() { # if a second argunment is given (and non-empty), # if will be perform error check unset _folder_namespace _folder_target _folder_full - operation="$2" + # operation="$2" # error_check="$2" if [ -z "$1" ]; then # if [ -n "$error_check" ]; then diff --git a/man/man1/shsh-cleanup.1 b/man/man1/shsh-cleanup.1 index ac3dc12..3a40a15 100644 --- a/man/man1/shsh-cleanup.1 +++ b/man/man1/shsh-cleanup.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B shsh \fI\,cleanup \/\fR[\fI\,-d|--dry\/\fR] diff --git a/man/man1/shsh-commands.1 b/man/man1/shsh-commands.1 index 5f72c4d..b8ecc9d 100644 --- a/man/man1/shsh-commands.1 +++ b/man/man1/shsh-commands.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B shsh \fI\,commands\/\fR diff --git a/man/man1/shsh-completions.1 b/man/man1/shsh-completions.1 index bbe0b9e..d95da7b 100644 --- a/man/man1/shsh-completions.1 +++ b/man/man1/shsh-completions.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B shsh \fI\,completions \/\fR diff --git a/man/man1/shsh-edit.1 b/man/man1/shsh-edit.1 index 3f1048c..4d2de20 100644 --- a/man/man1/shsh-edit.1 +++ b/man/man1/shsh-edit.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B shsh \fI\,edit\/\fR diff --git a/man/man1/shsh-get.1 b/man/man1/shsh-get.1 index b9a7103..6898262 100644 --- a/man/man1/shsh-get.1 +++ b/man/man1/shsh-get.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B shsh \fI\,get \/\fR diff --git a/man/man1/shsh-help.1 b/man/man1/shsh-help.1 index 1a5cfcc..9dcf54f 100644 --- a/man/man1/shsh-help.1 +++ b/man/man1/shsh-help.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B shsh \fI\,help \/\fR[\fI\,--usage\/\fR] \fI\,COMMAND\/\fR diff --git a/man/man1/shsh-init.1 b/man/man1/shsh-init.1 index b6c2872..15037a4 100644 --- a/man/man1/shsh-init.1 +++ b/man/man1/shsh-init.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B eval \fI\,"$(shsh init SHELL)"\/\fR diff --git a/man/man1/shsh-install.1 b/man/man1/shsh-install.1 index 749d87e..1b9bd5b 100644 --- a/man/man1/shsh-install.1 +++ b/man/man1/shsh-install.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B shsh \fI\,install \/\fR[\fI\,site\/\fR]\fI\,/\/\fR[\fI\,@ref\/\fR] [\fI\,/\/\fR] diff --git a/man/man1/shsh-junest.1 b/man/man1/shsh-junest.1 index 580064c..e58bf27 100644 --- a/man/man1/shsh-junest.1 +++ b/man/man1/shsh-junest.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B shsh \fI\,junest \/\fR[\fI\,-h|--help\/\fR] \fI\,\/\fR diff --git a/man/man1/shsh-link.1 b/man/man1/shsh-link.1 index 6236011..8c32829 100644 --- a/man/man1/shsh-link.1 +++ b/man/man1/shsh-link.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B shsh \fI\,link \/\fR[\fI\,--no-deps\/\fR] \fI\, \/\fR[\fI\,-h|--hook \/\fR] [\fI\,-v|--variable =\/\fR] diff --git a/man/man1/shsh-list.1 b/man/man1/shsh-list.1 index 8b6ba9f..865a323 100644 --- a/man/man1/shsh-list.1 +++ b/man/man1/shsh-list.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B shsh \fI\,list \/\fR[\fI\,-d|--details\/\fR] diff --git a/man/man1/shsh-outdated.1 b/man/man1/shsh-outdated.1 index e67e1aa..bc05b5d 100644 --- a/man/man1/shsh-outdated.1 +++ b/man/man1/shsh-outdated.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B shsh \fI\,outdated \/\fR[\fI\,-q|--quiet\/\fR] diff --git a/man/man1/shsh-package-path.1 b/man/man1/shsh-package-path.1 index dfb4592..e5533be 100644 --- a/man/man1/shsh-package-path.1 +++ b/man/man1/shsh-package-path.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B source \fI\,"$(shsh package-path )/file.sh"\/\fR diff --git a/man/man1/shsh-refresh.1 b/man/man1/shsh-refresh.1 index 9d1492f..0c7dc57 100644 --- a/man/man1/shsh-refresh.1 +++ b/man/man1/shsh-refresh.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B shsh \fI\,refresh \/\fR[\fI\,--verbose\/\fR] [\fI\,-a|--all\/\fR] diff --git a/man/man1/shsh-self-upgrade.1 b/man/man1/shsh-self-upgrade.1 index 8b2a528..5c97bb6 100644 --- a/man/man1/shsh-self-upgrade.1 +++ b/man/man1/shsh-self-upgrade.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B shsh \fI\,self-upgrade\/\fR diff --git a/man/man1/shsh-uninstall.1 b/man/man1/shsh-uninstall.1 index 9d493b4..13e2980 100644 --- a/man/man1/shsh-uninstall.1 +++ b/man/man1/shsh-uninstall.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B shsh \fI\,uninstall \/\fR diff --git a/man/man1/shsh-upgrade.1 b/man/man1/shsh-upgrade.1 index 6a62ac4..827914b 100644 --- a/man/man1/shsh-upgrade.1 +++ b/man/man1/shsh-upgrade.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B shsh \fI\,upgrade \/\fR[\fI\,-f|--force\/\fR] diff --git a/man/man1/shsh.1 b/man/man1/shsh.1 index e09f1de..db763c7 100644 --- a/man/man1/shsh.1 +++ b/man/man1/shsh.1 @@ -1,7 +1,7 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH SHSH "1" "May 2023" "shell script handler v3.0.1" "User Commands" +.TH SHSH "1" "August 2023" "shell script handler v3.0.2" "User Commands" .SH NAME -shsh \- manual page for shsh v3.0.1 +shsh \- manual page for shsh v3.0.2 .SH SYNOPSIS .B shsh \fI\, \/\fR[\fI\,\/\fR] [\fI\,--verbose\/\fR] [\fI\,--help\/\fR] From 7e9488ec8eeffd758b68871696603a86a8161c01 Mon Sep 17 00:00:00 2001 From: Tin Lai Date: Thu, 24 Aug 2023 11:54:37 +1000 Subject: [PATCH 7/9] remove line number in test as line number can change depending on whether junest is in use Signed-off-by: Tin Lai --- tests/shsh-init.bats | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/shsh-init.bats b/tests/shsh-init.bats index 2ef0d10..d30c63a 100644 --- a/tests/shsh-init.bats +++ b/tests/shsh-init.bats @@ -17,37 +17,37 @@ load test_helper @test "exports SHSH_PREFIX" { SHSH_PREFIX=/lol run shsh-init bash assert_success - assert_line -n 1 'export SHSH_PREFIX="/lol"' + assert_line 'export SHSH_PREFIX="/lol"' } @test "exports SHSH_PACKAGES_PATH" { SHSH_PACKAGES_PATH=/lol/packages run shsh-init bash assert_success - assert_line -n 2 'export SHSH_PACKAGES_PATH="/lol/packages"' + assert_line 'export SHSH_PACKAGES_PATH="/lol/packages"' } @test "adds junest to path" { run shsh-init bash assert_success - assert_line -n 3 'export SHSH_JUNEST_BIN="/home/tin/.local/share/shsh/cellar/arch_junest_root/junest_bin"' - assert_line -n 4 'export PATH="$PATH:$SHSH_JUNEST_BIN"' + assert_line 'export SHSH_JUNEST_BIN="/home/tin/.local/share/shsh/cellar/arch_junest_root/junest_bin"' + assert_line 'export PATH="$PATH:$SHSH_JUNEST_BIN"' } @test "adds cellar/bin to path" { run shsh-init bash assert_success - assert_line -n 5 'export PATH="$SHSH_ROOT/cellar/bin:$PATH"' + assert_line 'export PATH="$SHSH_ROOT/cellar/bin:$PATH"' } @test "setup include function if it exists" { run shsh-init bash - assert_line -n 6 '. "$SHSH_ROOT/lib/include.bash"' + assert_line '. "$SHSH_ROOT/lib/include.bash"' } @test "setup shsh completions if available" { run shsh-init bash assert_success - assert_line -n 7 '. "$SHSH_ROOT/completions/shsh.bash"' + assert_line '. "$SHSH_ROOT/completions/shsh.bash"' } @test "doesn't setup include function if it doesn't exist" { From 315d7aeeabd23392e5b0273eab90b0e4f94d7e1b Mon Sep 17 00:00:00 2001 From: Tin Lai Date: Thu, 24 Aug 2023 11:58:44 +1000 Subject: [PATCH 8/9] junest does not exists in CI server Signed-off-by: Tin Lai --- tests/shsh-init.bats | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/shsh-init.bats b/tests/shsh-init.bats index d30c63a..58423b2 100644 --- a/tests/shsh-init.bats +++ b/tests/shsh-init.bats @@ -26,13 +26,6 @@ load test_helper assert_line 'export SHSH_PACKAGES_PATH="/lol/packages"' } -@test "adds junest to path" { - run shsh-init bash - assert_success - assert_line 'export SHSH_JUNEST_BIN="/home/tin/.local/share/shsh/cellar/arch_junest_root/junest_bin"' - assert_line 'export PATH="$PATH:$SHSH_JUNEST_BIN"' -} - @test "adds cellar/bin to path" { run shsh-init bash assert_success From b955dc02906980819736bfcefa33d52288c5f4c0 Mon Sep 17 00:00:00 2001 From: Tin Lai Date: Fri, 25 Aug 2023 11:41:32 +1000 Subject: [PATCH 9/9] Update ci.yaml --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 04aa7fa..aa011f6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,7 +7,7 @@ jobs: matrix: os: - ubuntu-latest - - ubuntu-18.04 + # - ubuntu-18.04 # - ubuntu-16.04 - macos-latest # - macos-10.14