Skip to content
This repository has been archived by the owner on Aug 29, 2021. It is now read-only.

jzacsh/yabashlib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Yet Another Bash Library: yabashlib Some stuff I wrote when I was creating a needlessly complicated dotfiles manager and installer, strictly in Bash. Sharing just this part of that adventure, so the next time I want moderately pleasant scripting behavior (mostly in logging.sh), it will be here and tested.

Usage Build Status

Installation

To easily use yabashlib methods, just symlink yabashlib repo from the top-level of this directory, into somewhere in your path. eg:

ln -sv ~/src/yabasshlib/yabashlib ~/bin/

(assuming you keep this repo cloned into ~/src/ and ~/bin/ is in your $PATH)

Short Version

Given "installation" ($PATH) step described above, just:

#!/usr/bin/env bash

source yabashlib

# your script here...

Long Version

Alternatively, source individual libs from your own bash script, eg:

#!/usr/bin/env bash
#
# MyScript that does awesome things to $1 dir

source "files.sh" $@
source "logging.sh" $@
source "behavior.sh" 'MyScript'

# from  behavior.sh
trap dieSigInt SIGINT


myScriptCleanup() { some tear down stuff }


#
# ... some setup stuff
#


# from files.sh
isDirectoryEmpty "$1" && {
  # from logging.sh
  logWarning 'No work to do here!\n'
  myScriptCleanup
  exit
}


test -r '.myscript-config'; dieOnFail "$?" '.myscript-config not found'

Contribute

$EDITOR ./src/*         # change all the things
$EDITOR ./spec/suite/*  # test all the things
./test.sh               # show your work

About

[clone of the original at https://gitlab.com/jzacsh/yabashlib] Yet Another Bash Library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages