Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chemaclass/bashdep
A simple dependency manager for bash
https://github.com/chemaclass/bashdep
bash bash-script bashunit dependency-manager
Last synced: about 1 month ago
JSON representation
A simple dependency manager for bash
- Host: GitHub
- URL: https://github.com/chemaclass/bashdep
- Owner: Chemaclass
- License: mit
- Created: 2024-10-05T17:50:29.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-05T22:13:46.000Z (3 months ago)
- Last Synced: 2024-12-01T00:50:28.603Z (about 1 month ago)
- Topics: bash, bash-script, bashunit, dependency-manager
- Language: Shell
- Homepage:
- Size: 328 KB
- Stars: 18
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# bashdep
A minimalistic and straightforward **bash dependency manager**.
---
### Usage
#### bashdep::install
You can distinguish between regular dependencies and dev-dependencies when defining the URL.
Dev-dependencies ends with `@dev````bash
DEPENDENCIES=(
"https://github.com/[...]/download/0.17.0/bashunit"
"https://github.com/[...]/download/0.1/dumper.sh@dev"
)bashdep::install "${DEPENDENCIES[@]}"
```#### bashdep::setup
Alternately, you can configure the default values of bashdep using the setup function.
- `dir=string`: set the default destination directory. Default: `lib`
- `dev-dir=string`: set the development destination directory. Default: `lib/dev`
- `silent=bool`: if true, no progress text will be shown during installation. Default: `false````bash
bashdep::setup dir="lib" dev-dir="src/dev" silent=false
bashdep::install "${DEPENDENCIES[@]}"
```### Demo
Usage example from
[Chemaclass/bash-skeleton](https://github.com/Chemaclass/bash-skeleton/blob/main/install-dependencies.sh)```bash
#!/bin/bash
[ ! -f lib/bashdep ] && {
mkdir -p lib
curl -sLo lib/bashdep https://github.com/Chemaclass/bashdep/releases/download/0.1/bashdep
chmod +x lib/bashdep
}DEPENDENCIES=(
"https://github.com/TypedDevs/bashunit/releases/download/0.17.0/bashunit"
"https://github.com/Chemaclass/create-pr/releases/download/0.6/create-pr"
"https://github.com/Chemaclass/bash-dumper/releases/download/0.1/dumper.sh@dev"
)source lib/bashdep
bashdep::setup dir="lib" dev-dir="src/dev" silent=false
bashdep::install "${DEPENDENCIES[@]}"
```#### Output
```bash
Downloading 'bashunit' to 'lib'...
> bashunit installed successfully in 'lib'
Downloading 'create-pr' to 'lib'...
> create-pr installed successfully in 'lib'
Downloading 'dumper.sh' to 'src/dev'...
> dumper.sh installed successfully in 'src/dev'
```