Shell library and binaries.
-
Clone this repo to
~/.chouti-shell
:git clone https://github.com/honghaoz/chouti-shell.git ~/.chouti-shell
-
Run
install.sh
to install binaries.~/.chouti-shell/install.sh
This will add
~/.chouti-shell/bin
to yourPATH
environment variable.
Just execute the binaries in ~/.chouti-shell/bin
:
For example, to use swift-build
, run:
swift-build --arch arm64 --install usr/local/bin
-
Add the following lines to the top of your shell script:
#!/bin/bash # shellcheck disable=SC1091 source "$HOME/.chouti-shell/lib.sh" || exit 1
-
Use utility functions in your script, such as
prompt
:reply="" prompt "Do you want to continue?" "reply=\"y\"" "reply=\"n\"" "reply=\"n\"" if [[ "$reply" == "y" ]]; then to continue... else to exit... fi