Skip to content

bashembler, contraction for bash-assembler build one-file bash script by including assembled script and sourced scripts into an unique output file.

License

Notifications You must be signed in to change notification settings

biapy/bashembler

Repository files navigation

Bashembler

linting tests codecov CodeFactor

Bashembler -- contraction for bash-assembler -- aims to ease shell scripts development by providing a way to split lengthy scripts in multiple files included by source or . (dot) instructions, and assembling these files in a final single-file script, ready for deployment.

Bashembler @ Docker Hub.

Usage

Process script.bash and output the result to stdout:

bashembler 'script.bash'
# Using docker
docker run --rm --volume '.:/data'  'biapy/bashembler' 'script.bash'

Process script.sh and store result in bin/script-for-deployment:

bashembler --output='bin/script-for-deployment' 'script.bash'
# Using docker
docker run --rm --volume '.:/data'  'biapy/bashembler' \
  --output='bin/script-for-deployment' 'script.bash'

Optionally, strip comments from result:

bashembler --discard-comments 'script.bash'
# Using docker
docker run --rm --volume '.:/data'  'biapy/bashembler' \
  --discard-comments 'script.bash'

Third party libraries

Bashembler makes use of:

Contributing

Git

Cloning

This library uses the ShellSpec library for unit-testing.

Clone the repository with the additionnal libraries:

git clone --recurse-submodules '[email protected]:biapy/bashembler'

Updating submodules

Update the submodules with:

git submodule update --remote

Utilities

The Makefile provides these rules:

  • help : Display a short help message about the rules available in the Makefile.
  • clean : Delete generated documentation in doc/ and remove functions list from README.md.
  • format : format files using shfmt on *.bash files in src/ and *.bats files in test/.
  • check : check files for errors using shellcheck on *.bash files in src/.
  • test : run unit tests.
  • doc : Generate documentation in doc/ using shdoc.
  • all : All of the above.

About

bashembler, contraction for bash-assembler build one-file bash script by including assembled script and sourced scripts into an unique output file.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published