Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 1.92 KB

File metadata and controls

54 lines (40 loc) · 1.92 KB

bash-utils

A collection of bash shell utilities

Setup of WSL distribution for debug and testing

Debug and testing is performed against a Ubuntu WSL distribution, create as follows, specifying --name bash-utils:

    wsl --install Ubuntu --name bash-utils
    < specify username and password when prompted >

Leverage the Bats (Bash Automated Testing System) testing framework for our utilities.

More detail on bats can be found here https://bats-core.readthedocs.io/en/stable/

Update the distro with the latest security and package updates.

    sudo apt update
    sudo apt upgrade -y
    sudo apt install make

Unit Testing

On your local machine running the bash-utils WSL distro, open Visual Studio Code and select Ctrl+Shift+P -> WSL: Open Folder in WSL... - select the cloned bash-utils REPO folder. When prompted, select Open Workspace, then if prompted select Install to install the recommended Visual Studio Code extensions in the WSL distro.

Add global email and username configuration values - this needs to be done only once.

    git config --global user.email "Craig.Lemon@gmail.com"
    git config --global user.name "Craig Lemon"

The following Visual Studio Code Extensions are listed in the workspace file, and installed above

  • Extension Test Runner
  • Bats (Bash Automated Testing System)
  • BATS Test Runner

Install the Bats components, including libraries locally in the REPO (.gitignore prevents the BAts components from being committed)

    make setup

To run the tests in the project, run make test

Installation

To install bash-utils on the local machne, run the following commands:

    curl -L "https://raw.githubusercontent.com/craiglemon/bash-utils/master/install.sh" -o ~/install.sh
    chmod +x ~/install.sh
    sudo ~/install.sh

Note: Keep install.sh up to date as the bash-utils project grows.