Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

BitFis/bash-markdown-code-extractor

Open more actions menu

Repository files navigation

Bash Scripts

Those scripts should help setting things up and prepare the test environment.

Test Scripts

For script quality, bats was used to test the scripts, it will mock the calls to the actual programs and just tests that the scripts du what they should by checking input and the external calls. Running the test scripts will not change any state on the machine.

To run the test, bats needs to be installed.

git clone https://github.com/sstephenson/bats.git
cd bats
./install.sh /usr/local

Simple Conditionals

Following a cheatsheet of conditionals to help prevent running commands multiple times. Those are valid bash conditions, which are just beeing checked before the actual script is run.

[//]: #conditional (! command -v [command] &> /dev/null)
```bash
# only execute block if [command] does not exist
sudo apt -y install [command]
...
[//]: #conditional ([[ "$OSTYPE" == "linux-gnu" ]])
```bash
# run if OSTYPE is "linux-gnu"
cmake -DLINUX_GNU
...
[//]: #conditional ([[ ! -f [file] ]])
```bash
# only execute block if [file] does not exist
touch file
...

Related projects

  • @mdsh: Enables Multi-Lingual Literate Programming withhin markdown

About

Enable extraction of markdown code blocks through the bash script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.