Skip to content

reconquest/import.bash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

import.bash

bash import directive, like in Golang.

import-bash-2

Usage

source "vendor/github.com/reconquest/import.bash/import.bash"

import:use "path/to/any/lib.bash"

How does it work?

import.bash will look into vendor directory and, if vendor missing, will try to clone it.

Then, file named same as last part of the import name will be sourced.

Example

source "vendor/github.com/reconquest/import.bash/import.bash"

import:use "github.com/reconquest/opts.bash"

declare -a args
declare -A opts

opts:parse opts args -a -b: -- "${@}"

echo "-a: ${opts[-a]}"
echo "-b: ${opts[-b]}"

echo "args: ${args[@]}"

Reference

See reference at REFERENCE.md.

Various libs

About

Golang-like import statement in bash

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages