bash-compiler command

1. Usage

The framework works with bash-compiler, a GoLang implementation that generates standalone executables from YAML definitions.

Using bash-compiler binary:

export PATH=$PATH:/home/wsl/fchastanet/bash-compiler/bin
FRAMEWORK_ROOT_DIR=$(pwd) bash-compiler \
  src/_binaries/shellcheckLint/shellcheckLint-binary.yaml

Using Go interpreter (must be executed from bash-compiler folder):

export FRAMEWORK_ROOT_DIR=/home/wsl/fchastanet/bash-dev-env/vendor/bash-tools-framework
go run ./cmd/bash-compiler "${FRAMEWORK_ROOT_DIR}/src/_binaries/shellcheckLint/shellcheckLint-binary.yaml"

Compile all *-binary.yaml files at once:

export FRAMEWORK_ROOT_DIR=/home/wsl/fchastanet/bash-dev-env/vendor/bash-tools-framework
go run ./cmd/bash-compiler $(find "${FRAMEWORK_ROOT_DIR}/src/_binaries" -name '*-binary.yaml' -print)

See Bash Compiler documentation for more information.

2. Example: Creating a Command

To create a new command using the framework:

  1. Create a YAML definition in src/_binaries/myCommand/myCommand-binary.yaml
  2. Define the command’s options and main script
  3. Compile using bash-compiler
  4. The generated binary will be placed in bin/myCommand

See the framework command template for a starting point.

3. More info

Or, if you want, you can alternatively use the GitHub discussion Q&A for feedback and questions.