GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - jzacsh/yabashlib: MIRROR of gitlab.com/jzacsh/yabashlib

BranchesTags
Open more actions menu

Latest commit

 

History

122 Commits
122 Commits

Folders and files

NameName
Last commit message
Last commit date
spec
spec
 
 
src
src
 
 
vendor
vendor
 
 
.gitignore
.gitignore
 
 
.gitlab-ci.yml
.gitlab-ci.yml
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
readme.md
readme.md
 
 
test.sh
test.sh
 
 
yabashlib
yabashlib
 
 

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
make test               # show your work

Upgrading BATs

./test.sh has some inline documentation on this, but tl;dr is there's a mocking bug in the latest upstream bats.

If you're testing that issue you can do so easily by:

  1. $EDITOR ./test.sh
  2. temporarily set use_vendored_bats to 0
  3. temporarily set is_issue_509_resolved to 1
  4. clear previous test caching of BATs itself: make cleanbats
  5. re-run tests: make test - this will now be affected by steps 2 and 3, and your test will run from a bleeding-edge download of bats-core upstream, (without properly refreshing the vendored copy, as one should when not testing, via vendor/update.sh).

About

MIRROR of gitlab.com/jzacsh/yabashlib

gitlab.com/jzacsh/yabashlib

Resources

Readme
Apache-2.0 license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.