A package manager for bash scripts and functions.
-
Checkout basher on
~/.basher
$ git clone git://github.com/basherpm/basher.git ~/.basher
-
Add
~/.basher/bin
to$PATH
for easy access to the basher command-line utility.$ echo 'export PATH="$HOME/.basher/bin:$PATH"' >> ~/.bash_profile
Ubuntu Desktop note: Modify your
~/.bashrc
instead of~/.bash_profile
.Zsh note: Modify your
~/.zshrc
file instead of~/.bash_profile
. -
Add
basher init
to your shell to enable basher runtime functions$ echo 'eval "$(basher init -)"' >> ~/.bash_profile
Same as in previous step, use
~/.bashrc
on Ubuntu,~/.zshrc
for Zsh.
$ basher install sstephenson/bats
This will install bats from https://github.com/sstephenson/bats and add bin/bats
it to the PATH.
If a package exports a runtime, you can include it in the current shell by running, for instance:
require juanibiapina/gg
basher commands
- List commandsbasher help <command>
- Displays help for a commandbasher uninstall <package>
- Uninstall a packagebasher update
- Update basher to latest version from masterbasher list
- List installed packagesbasher outdated
- List packages which are not in the latest versionbasher upgrade <package>
- Upgrades a package to the latest version
Packages are github repos (username/repo) which contain a package.sh
file with the following format:
BIN=bin/exec1:bin/exec2
RUNTIME=lib/functions.sh
BIN is a ":" separated list of binaries that will be added to the path.
RUNTIME is a file that will be sourced when using the require
function.
If a package.sh
file is not found, basher will try to link any binaries inside the bin
folder of the project.
To run the tests, install bats:
$ basher install sstephenson/bats
and then run:
$ bats tests