mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-08-19 03:56:16 +00:00
doc+feat(webi): update PATH instructions, fix typos
This commit is contained in:
@@ -32,7 +32,7 @@ More technically:
|
||||
- common release APIs are in `_common/` (i.e. `_common/github.js`)
|
||||
2. `_webi/bootstrap.sh` is a template that exchanges system information for a
|
||||
correct installer
|
||||
- contructs a user agent with os, cpu, and utility info (i.e. `macos`,
|
||||
- constructs a user agent with os, cpu, and utility info (i.e. `macos`,
|
||||
`amd64`, can unpack `tar,zip,xz`)
|
||||
3. `_webi/template.sh` is the base installer template with common functions for
|
||||
- checking versions
|
||||
@@ -185,7 +185,7 @@ pkg_get_current_version() {
|
||||
}
|
||||
```
|
||||
|
||||
For the rest of the functions you can like copy/paste from the examples:
|
||||
For the rest of the functions you can copy/paste from the examples:
|
||||
|
||||
```bash
|
||||
pkg_format_cmd_version() {} # Override, pretty prints version
|
||||
|
||||
+7
-8
@@ -130,14 +130,13 @@ function __webi_main () {
|
||||
if [ -f "\$_webi_tmp/.PATH.env" ]; then
|
||||
my_paths=\$(cat "\$_webi_tmp/.PATH.env" | sort -u)
|
||||
if [ -n "\$my_paths" ]; then
|
||||
echo "IMPORTANT: You must update you PATH to use the installed program(s)"
|
||||
echo ""
|
||||
echo "You can either"
|
||||
echo "A) can CLOSE and REOPEN Terminal or"
|
||||
echo "B) RUN these exports:"
|
||||
echo ""
|
||||
echo "\$my_paths"
|
||||
echo ""
|
||||
printf 'PATH.env updated with:\\n'
|
||||
printf "%s\\n" "\$my_paths"
|
||||
printf '\\n'
|
||||
printf "\\e[31mTO FINISH\\e[0m: copy, paste & run the following command:\\n"
|
||||
printf "\\n"
|
||||
printf " \\e[34msource ~/.config/envman/PATH.env\\e[0m\\n"
|
||||
printf " (newly opened terminal windows will update automatically)\\n"
|
||||
fi
|
||||
rm -f "\$_webi_tmp/.PATH.env"
|
||||
fi
|
||||
|
||||
+14
-4
@@ -244,8 +244,12 @@ function __bootstrap_webi() {
|
||||
|
||||
# in case pathman was recently installed and the PATH not updated
|
||||
mkdir -p "$_webi_tmp"
|
||||
# prevent "too few arguments" output on bash when there are 0 lines of stdout
|
||||
"$HOME/.local/bin/pathman" add "$1" | grep "export" 2> /dev/null >> "$_webi_tmp/.PATH.env" || true
|
||||
# 'true' to prevent "too few arguments" output on bash
|
||||
# when there are 0 lines of stdout
|
||||
"$HOME/.local/bin/pathman" add "$1" |
|
||||
grep "export" 2> /dev/null \
|
||||
>> "$_webi_tmp/.PATH.env" ||
|
||||
true
|
||||
}
|
||||
|
||||
# group common pre-install tasks as default
|
||||
@@ -404,10 +408,16 @@ function __bootstrap_webi() {
|
||||
webi_path_add "$HOME/.local/bin"
|
||||
if [[ -z ${_WEBI_CHILD:-} ]] && [[ -f "$_webi_tmp/.PATH.env" ]]; then
|
||||
if [[ -n $(cat "$_webi_tmp/.PATH.env") ]]; then
|
||||
echo "You need to update your PATH to use $PKG_NAME:"
|
||||
echo ""
|
||||
printf 'PATH.env updated with:\n'
|
||||
sort -u "$_webi_tmp/.PATH.env"
|
||||
printf "\n"
|
||||
|
||||
rm -f "$_webi_tmp/.PATH.env"
|
||||
|
||||
printf "\e[31mTO FINISH\e[0m: copy, paste & run the following command:\n"
|
||||
printf "\n"
|
||||
printf " \e[34msource ~/.config/envman/PATH.env\e[0m\n"
|
||||
printf " (newly opened terminal windows will update automatically)\n"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user