Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/honghaoz/chouti-shell
Some convenient shell functions
https://github.com/honghaoz/chouti-shell
Last synced: 11 days ago
JSON representation
Some convenient shell functions
- Host: GitHub
- URL: https://github.com/honghaoz/chouti-shell
- Owner: honghaoz
- License: mit
- Created: 2022-10-23T23:09:25.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-06T00:41:21.000Z (5 months ago)
- Last Synced: 2024-06-06T01:51:40.869Z (5 months ago)
- Language: Shell
- Size: 140 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# chouti-shell
Shell library and binaries.
## Installation
1. Clone this repo to `~/.chouti-shell`:
```bash
git clone https://github.com/honghaoz/chouti-shell.git ~/.chouti-shell
```2. Run `install.sh` to install binaries.
```bash
~/.chouti-shell/install.sh
```This will add `~/.chouti-shell/bin` to your `PATH` environment variable.
## Usage
### Use binaries
Just execute the binaries in `~/.chouti-shell/bin`:
For example, to use `swift-build`, run:
```bash
swift-build --arch arm64 --install usr/local/bin
```### Use shell library
1. Add the following lines to the top of your shell script:
```bash
#!/bin/bash# shellcheck disable=SC1091
source "$HOME/.chouti-shell/lib.sh" || exit 1
```2. Use utility functions in your script, such as `prompt`:
```bash
reply=""
prompt "Do you want to continue?" "reply=\"y\"" "reply=\"n\"" "reply=\"n\""if [[ "$reply" == "y" ]]; then
to continue...
else
to exit...
fi
```