Skip to content

shellm-org/core

Repository files navigation

Be a Shell Master!

... or a Shell Magician? a Shell Mage? Anyway: it's a shell library sourcing system.

pipeline status gitter chat

shellm is a library sourcing / loading system.

It lets you define a LIBPATH variable. Just like PATH, LIBPATH is a semi-colon separated list of directories. You will then be able to source files from these directories with shellm source.

Demo

Installation

Installation is done with basher:

basher install gitlab.com/shellm/core

Usage

If you want to use shellm in your current shell or in a script, simply enter the following instruction or add it at the beginning of your script:

source $(shellm-core-path)

You now have access to the shellm source command which allows you to source a file located somewhere in your LIBPATH.

Typically, for a package installed with basher:

shellm source namespace/package
# or just a specific file:
# shellm source namespace/package/lib/main.sh

For files listed in a personal directory, something like

/path/to/my/lib/
├── bookmark.sh
├── cd.sh
└── env
    ├── aliases.sh
    ├── completion.sh
    └── goenv.sh

...and LIBPATH=/path/to/my/lib:$LIBPATH:

shellm source bookmark.sh
shellm source env/aliases.sh