日本語: [JA_README.md]
a library manager for bash script. Not a Package Manager. ( package manager for bash is here,bpkg/bpkg)
This project uses niieani/bash-oo-framework as basement. The import command is provided by the framework.
blib install <lib_name>-- install <lib_name>blib uninstall <lib_name>-- uninstall <lib_name>blib list-- show all installed librariesblib info <lib>-- show library infomationblib man <lib>-- show details about
- 'import' command -- import given library more easier. use
import blib:<lib>
- BLIB_ROOT -- the path where all libraries installed. default:
/usr/local/etc/blib/lib(For homebrew: it will be/usr/local/Cellar/blib/<version>/lib)
- bash-completion for
blib - vim-completion for import
- bpkg support
- homebrew support
- bash-oo-framework -- the basement framework. This is implemented.
- git -- to clone libraries
- realpath -- to verify library name. provided by gnucoreutil, etc.
from source is available now.
I'm working on homebrew
-
bpkg
$ bpkg install Cj-bc/blib $ echo "export BLIB_ROOT=/if/you/want/some/other/path" -
homebrew
$ brew insatll Cj-bc/blib/blib $ echo "export BLIB_ROOT=/if/you/want/some/other/path" -
from source
$ git clone https://github.com/Cj-bc/blib.git $ cd blib $ make install # if you want to define ROOT directory(where blib itself will be put. libraries will be installed to `ROOT/lib`), $ make root=<your/path> install # if you want to re-install without uninstall, set `FORCE_INSTALL` to 'true'. # by default, `make install` will fail if `blib` command is available. $ make FORCE_INSTALL=true install # Of cource, you can combine both $ make root=<your/path> FORCE_INSTALL=true install
You should add this line at the top of your script(of course after shebang):
source "$(blib --prefix)/bash-oo-framework/lib/oo-bootstrap.sh"By doing this, you can use import command to import libraries.
In this case, Do not use official bash-oo-framework because it doesn't support blib
Or, you can source libraries directly by doing:
source "$(blib --prefix)/path/to/the/script"