Skip to content
/ blib Public

a library manager for shellscripts using bash-oo-framework

Notifications You must be signed in to change notification settings

Cj-bc/blib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

日本語: [JA_README.md]

blib

a library manager for bash script. Not a Package Manager. ( package manager for bash is here,bpkg/bpkg)

This project uses bash-oo-framework as basement.

This project uses niieani/bash-oo-framework as basement. The import command is provided by the framework.

feature

Commands:

  • blib install <lib_name> -- install <lib_name>
  • blib uninstall <lib_name> -- uninstall <lib_name>
  • blib list -- show all installed libraries
  • blib info <lib> -- show library infomation
  • blib man <lib> -- show details about

Command for scripting

  • 'import' command -- import given library more easier. use import blib:<lib>

Environmental vars

  • 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)

Supports:

  • bash-completion for blib
  • vim-completion for import
  • bpkg support
  • homebrew support

dependencies

  • bash-oo-framework -- the basement framework. This is implemented.
  • git -- to clone libraries
  • realpath -- to verify library name. provided by gnucoreutil, etc.

installation

from source is available now.
I'm working on homebrew

  1. bpkg $ bpkg install Cj-bc/blib $ echo "export BLIB_ROOT=/if/you/want/some/other/path"

  2. homebrew $ brew insatll Cj-bc/blib/blib $ echo "export BLIB_ROOT=/if/you/want/some/other/path"

  3. 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

how to make scripts using blib libraries

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"

About

a library manager for shellscripts using bash-oo-framework

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published