Skip to content

Commit

Permalink
add command to self-linking
Browse files Browse the repository at this point in the history
Signed-off-by: Tin Lai <oscar@tinyiu.com>
  • Loading branch information
soraxas committed Jul 1, 2024
1 parent ad66e34 commit 6769d32
Show file tree
Hide file tree
Showing 21 changed files with 161 additions and 54 deletions.
2 changes: 1 addition & 1 deletion libexec/shsh
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ for arg; do
;;
--version)
cat << EOF
shsh (shell script handler) v3.1.1
shsh (shell script handler) v3.1.2
Copyright (c) 2014 Juan Ibiapina, 2020 Tin Lai (@soraxas)
This is free software; see the source for copying conditions. There is NO
Expand Down
14 changes: 14 additions & 0 deletions libexec/shsh-self-linking
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env sh
# Summary: Link shsh's completion and man files to shsh's own cellar
#
# Usage: shsh self-linking
#

set -e
# shellcheck source=libexec/shsh-_utils
. "${UTILS_FUNC:?}"

(
cd "$SHSH_ROOT" && make self-linking
)

5 changes: 3 additions & 2 deletions man/man1/shsh-cleanup.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "January 2024" "shell script handler v3.1.1" "User Commands"
.TH SHSH "1" "July 2024" "shell script handler v3.1.2" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.1.1
shsh \- manual page for shsh v3.1.2
.SH SYNOPSIS
.B shsh
\fI\,cleanup \/\fR[\fI\,-d|--dry\/\fR]
Expand Down Expand Up @@ -38,6 +38,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.B shsh-outdated (1),
.B shsh-package-path (1),
.B shsh-refresh (1),
.B shsh-self-linking (1),
.B shsh-self-upgrade (1),
.B shsh-uninstall (1),
.B shsh-upgrade (1)
5 changes: 3 additions & 2 deletions man/man1/shsh-commands.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "January 2024" "shell script handler v3.1.1" "User Commands"
.TH SHSH "1" "July 2024" "shell script handler v3.1.2" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.1.1
shsh \- manual page for shsh v3.1.2
.SH SYNOPSIS
.B shsh
\fI\,commands\/\fR
Expand Down Expand Up @@ -34,6 +34,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.B shsh-outdated (1),
.B shsh-package-path (1),
.B shsh-refresh (1),
.B shsh-self-linking (1),
.B shsh-self-upgrade (1),
.B shsh-uninstall (1),
.B shsh-upgrade (1)
5 changes: 3 additions & 2 deletions man/man1/shsh-completions.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "January 2024" "shell script handler v3.1.1" "User Commands"
.TH SHSH "1" "July 2024" "shell script handler v3.1.2" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.1.1
shsh \- manual page for shsh v3.1.2
.SH SYNOPSIS
.B shsh
\fI\,completions <command>\/\fR
Expand Down Expand Up @@ -33,6 +33,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.B shsh-outdated (1),
.B shsh-package-path (1),
.B shsh-refresh (1),
.B shsh-self-linking (1),
.B shsh-self-upgrade (1),
.B shsh-uninstall (1),
.B shsh-upgrade (1)
5 changes: 3 additions & 2 deletions man/man1/shsh-edit.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "January 2024" "shell script handler v3.1.1" "User Commands"
.TH SHSH "1" "July 2024" "shell script handler v3.1.2" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.1.1
shsh \- manual page for shsh v3.1.2
.SH SYNOPSIS
.B shsh
\fI\,edit\/\fR
Expand Down Expand Up @@ -32,6 +32,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.B shsh-outdated (1),
.B shsh-package-path (1),
.B shsh-refresh (1),
.B shsh-self-linking (1),
.B shsh-self-upgrade (1),
.B shsh-uninstall (1),
.B shsh-upgrade (1)
5 changes: 3 additions & 2 deletions man/man1/shsh-get.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "January 2024" "shell script handler v3.1.1" "User Commands"
.TH SHSH "1" "July 2024" "shell script handler v3.1.2" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.1.1
shsh \- manual page for shsh v3.1.2
.SH SYNOPSIS
.B shsh
\fI\,get <package>\/\fR
Expand Down Expand Up @@ -32,6 +32,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.B shsh-outdated (1),
.B shsh-package-path (1),
.B shsh-refresh (1),
.B shsh-self-linking (1),
.B shsh-self-upgrade (1),
.B shsh-uninstall (1),
.B shsh-upgrade (1)
5 changes: 3 additions & 2 deletions man/man1/shsh-help.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "January 2024" "shell script handler v3.1.1" "User Commands"
.TH SHSH "1" "July 2024" "shell script handler v3.1.2" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.1.1
shsh \- manual page for shsh v3.1.2
.SH SYNOPSIS
.B shsh
\fI\,help \/\fR[\fI\,--usage\/\fR] \fI\,COMMAND\/\fR
Expand Down Expand Up @@ -38,6 +38,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.B shsh-outdated (1),
.B shsh-package-path (1),
.B shsh-refresh (1),
.B shsh-self-linking (1),
.B shsh-self-upgrade (1),
.B shsh-uninstall (1),
.B shsh-upgrade (1)
5 changes: 3 additions & 2 deletions man/man1/shsh-init.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "January 2024" "shell script handler v3.1.1" "User Commands"
.TH SHSH "1" "July 2024" "shell script handler v3.1.2" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.1.1
shsh \- manual page for shsh v3.1.2
.SH SYNOPSIS
.B eval
\fI\,"$(shsh init SHELL)"\/\fR
Expand Down Expand Up @@ -32,6 +32,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.B shsh-outdated (1),
.B shsh-package-path (1),
.B shsh-refresh (1),
.B shsh-self-linking (1),
.B shsh-self-upgrade (1),
.B shsh-uninstall (1),
.B shsh-upgrade (1)
29 changes: 19 additions & 10 deletions man/man1/shsh-install.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "January 2024" "shell script handler v3.1.1" "User Commands"
.TH SHSH "1" "July 2024" "shell script handler v3.1.2" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.1.1
shsh \- manual page for shsh v3.1.2
.SH SYNOPSIS
.B shsh
\fI\,install \/\fR[\fI\,site\/\fR]\fI\,/<package>\/\fR[\fI\,@ref\/\fR] [\fI\,<folder>/<folder>\/\fR]
Expand Down Expand Up @@ -75,36 +75,44 @@ multiples are given, they will be run in sequential order.
a+x
Before linking, add executable bit to all files.
.SH EXAMPLES
.TP
.IP
shsh install soraxas/dot\-reminder
.IP
install 'soraxas/dot\-reminder' as a package
.TP
.IP
shsh install soraxas/git\-utils git/tools
.IP
install 'soraxas/git\-utils' to a folder within 'git/tools'
.TP
.IP
shsh install \-\-ssh <package>
.IP
install with ssh protocal (rather than https)
.TP
.IP
shsh install <package> \-v FISH_COMPLETIONS=synoservice.fish:forgit.fish
.IP
link 'synoservice.fish' and 'forgit.fish' as fish
completion files
.TP
.IP
shsh install <package> \-\-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)
.TP
.IP
shsh install <package> \-\-hook +x=foobar
.IP
add a hook that add executable bits to the file 'foobar',
before linking is performed
.TP
.IP
shsh install <package> \-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.
.TP
.IP
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
Expand Down Expand Up @@ -132,6 +140,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.B shsh-outdated (1),
.B shsh-package-path (1),
.B shsh-refresh (1),
.B shsh-self-linking (1),
.B shsh-self-upgrade (1),
.B shsh-uninstall (1),
.B shsh-upgrade (1)
5 changes: 3 additions & 2 deletions man/man1/shsh-junest.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "January 2024" "shell script handler v3.1.1" "User Commands"
.TH SHSH "1" "July 2024" "shell script handler v3.1.2" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.1.1
shsh \- manual page for shsh v3.1.2
.SH SYNOPSIS
.B shsh
\fI\,junest \/\fR[\fI\,-h|--help\/\fR] \fI\,<sub_command>\/\fR
Expand Down Expand Up @@ -42,6 +42,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.B shsh-outdated (1),
.B shsh-package-path (1),
.B shsh-refresh (1),
.B shsh-self-linking (1),
.B shsh-self-upgrade (1),
.B shsh-uninstall (1),
.B shsh-upgrade (1)
5 changes: 3 additions & 2 deletions man/man1/shsh-link.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "January 2024" "shell script handler v3.1.1" "User Commands"
.TH SHSH "1" "July 2024" "shell script handler v3.1.2" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.1.1
shsh \- manual page for shsh v3.1.2
.SH SYNOPSIS
.B shsh
\fI\,link \/\fR[\fI\,--no-deps\/\fR] \fI\,<directory> <package> \/\fR[\fI\,-h|--hook <hook>\/\fR] [\fI\,-v|--variable <VAR>=<VAL>\/\fR]
Expand Down Expand Up @@ -32,6 +32,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.B shsh-outdated (1),
.B shsh-package-path (1),
.B shsh-refresh (1),
.B shsh-self-linking (1),
.B shsh-self-upgrade (1),
.B shsh-uninstall (1),
.B shsh-upgrade (1)
5 changes: 3 additions & 2 deletions man/man1/shsh-list.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "January 2024" "shell script handler v3.1.1" "User Commands"
.TH SHSH "1" "July 2024" "shell script handler v3.1.2" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.1.1
shsh \- manual page for shsh v3.1.2
.SH SYNOPSIS
.B shsh
\fI\,list \/\fR[\fI\,-d|--details\/\fR] [\fI\,-a|--all\/\fR] [\fI\,-i|--installed\/\fR]
Expand Down Expand Up @@ -45,6 +45,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.B shsh-outdated (1),
.B shsh-package-path (1),
.B shsh-refresh (1),
.B shsh-self-linking (1),
.B shsh-self-upgrade (1),
.B shsh-uninstall (1),
.B shsh-upgrade (1)
5 changes: 3 additions & 2 deletions man/man1/shsh-outdated.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "January 2024" "shell script handler v3.1.1" "User Commands"
.TH SHSH "1" "July 2024" "shell script handler v3.1.2" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.1.1
shsh \- manual page for shsh v3.1.2
.SH SYNOPSIS
.B shsh
\fI\,outdated \/\fR[\fI\,-q|--quiet\/\fR]
Expand Down Expand Up @@ -32,6 +32,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.B shsh-outdated (1),
.B shsh-package-path (1),
.B shsh-refresh (1),
.B shsh-self-linking (1),
.B shsh-self-upgrade (1),
.B shsh-uninstall (1),
.B shsh-upgrade (1)
5 changes: 3 additions & 2 deletions man/man1/shsh-package-path.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "January 2024" "shell script handler v3.1.1" "User Commands"
.TH SHSH "1" "July 2024" "shell script handler v3.1.2" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.1.1
shsh \- manual page for shsh v3.1.2
.SH SYNOPSIS
.B source
\fI\,"$(shsh package-path <package>)/file.sh"\/\fR
Expand Down Expand Up @@ -32,6 +32,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.B shsh-outdated (1),
.B shsh-package-path (1),
.B shsh-refresh (1),
.B shsh-self-linking (1),
.B shsh-self-upgrade (1),
.B shsh-uninstall (1),
.B shsh-upgrade (1)
5 changes: 3 additions & 2 deletions man/man1/shsh-refresh.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "January 2024" "shell script handler v3.1.1" "User Commands"
.TH SHSH "1" "July 2024" "shell script handler v3.1.2" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.1.1
shsh \- manual page for shsh v3.1.2
.SH SYNOPSIS
.B shsh
\fI\,refresh <package> \/\fR[\fI\,--verbose\/\fR] [\fI\,-a|--all\/\fR]
Expand Down Expand Up @@ -32,6 +32,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.B shsh-outdated (1),
.B shsh-package-path (1),
.B shsh-refresh (1),
.B shsh-self-linking (1),
.B shsh-self-upgrade (1),
.B shsh-uninstall (1),
.B shsh-upgrade (1)
38 changes: 38 additions & 0 deletions man/man1/shsh-self-linking.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "July 2024" "shell script handler v3.1.2" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.1.2
.SH SYNOPSIS
.B shsh
\fI\,self-linking\/\fR
.SH DESCRIPTION
Link shsh's completion and man files to shsh's own cellar
.PP
Link shsh's completion and man files to shsh's own cellar
.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-linking (1),
.B shsh-self-upgrade (1),
.B shsh-uninstall (1),
.B shsh-upgrade (1)
5 changes: 3 additions & 2 deletions man/man1/shsh-self-upgrade.1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH SHSH "1" "January 2024" "shell script handler v3.1.1" "User Commands"
.TH SHSH "1" "July 2024" "shell script handler v3.1.2" "User Commands"
.SH NAME
shsh \- manual page for shsh v3.1.1
shsh \- manual page for shsh v3.1.2
.SH SYNOPSIS
.B shsh
\fI\,self-upgrade\/\fR
Expand Down Expand Up @@ -32,6 +32,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
.B shsh-outdated (1),
.B shsh-package-path (1),
.B shsh-refresh (1),
.B shsh-self-linking (1),
.B shsh-self-upgrade (1),
.B shsh-uninstall (1),
.B shsh-upgrade (1)
Loading

0 comments on commit 6769d32

Please sign in to comment.