Skip to content

Commit

Permalink
docs: feat: Write the flavors section of the README
Browse files Browse the repository at this point in the history
Signed-off-by: 林博仁(Buo-ren, Lin) <Buo.Ren.Lin@gmail.com>
  • Loading branch information
brlin-tw committed Nov 30, 2023
1 parent 94a375b commit 57190a3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@ Ready-to-use bash shell script templates at your fingertips!
<https://gitlab.com/the-common/bash-script-templates>
[![The GitLab CI pipeline status badge of the project's `main` branch](https://gitlab.com/the-common/bash-script-templates/badges/main/pipeline.svg?ignore_skipped=true "Click here to check out the comprehensive status of the GitLab CI pipelines")](https://gitlab.com/the-common/bash-script-templates/-/pipelines) [![GitHub Actions workflow status badge](https://github.com/the-common/bash-script-templates/actions/workflows/check-potential-problems.yml/badge.svg "GitHub Actions workflow status")](https://github.com/the-common/bash-script-templates/actions/workflows/check-potential-problems.yml) [![pre-commit enabled badge](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white "This project uses pre-commit to check potential problems")](https://pre-commit.com/) [![REUSE Specification compliance badge](https://api.reuse.software/badge/gitlab.com/the-common/bash-script-templates "This project complies to the REUSE specification to decrease software licensing costs")](https://api.reuse.software/info/gitlab.com/the-common/bash-script-templates)

## Flavors

This product provides several _flavors_ of the Bash script template to satisfy different needs:

### [PRIMITIVE](primitive.sh)

The considered to be the bare-minimum for bash scripting:

* Shebang/Hashbang file header
* Script description and copyright declaration header
* Defensive interpreter behavior settings

### [BASIC](basic.sh)

Inherited from the [PRIMITIVE](#primitive) flavor, but with the following additions:

* Runtime dependency detection(check whether all the required commands are available from the command search PATHs
* The following convenience variable definitions:
+ `script`: The absolute path of the shell script
+ `script_dir`: The absolute path of the directory that contains the shell script
+ `script_filename`: The full filename of the shell script
+ `script_name`: The name of the shellscript, excluding the filename suffixes

## References

* [The Common / The Common GNU Bash Shell Script Templates · GitLab](https://gitlab.com/the-common/bash-script-templates)
Expand Down

0 comments on commit 57190a3

Please sign in to comment.