Giter VIP home page Giter VIP logo

bsfl's Introduction

BSFL

Build Status

The Bash Shell Function Library (BSFL) is a small bash script that acts as a library for bash scripts. It provides a couple of functions that makes the lives of most people using shell scripts a bit easier.

This project is a fork of the original work of Louwrentius.

asciicast

Getting started

In order to use BSFL, you have to include the library in your bash scripts. You can do it with an absolute path:

source <absolute path to BSFL>

For example:

source /opt/bsfl/bsfl.sh

Or with a relative path:

declare -r DIR=$(cd "$(dirname "$0")" && pwd)
source $DIR/<relative path to BSFL>

For example:

declare -r DIR=$(cd "$(dirname "$0")" && pwd)
source $DIR/../lib/bsfl.sh

What's next?

The best way to learn how BSFL works is to look at the examples available in the examples folder.

Documentation

The online documentation is available here.

Building the documentation is done by using Doxygen:

cd <BSFL repository>/doc
git submodule update --init --recursive
doxygen Doxyfile

Dependencies

BSFL is implemented for bash version 4. Prior versions of bash will fail at interpreting its code.

In addition, BSFL depends of some external programs. Here is the list of these programs:

  • date
  • grep
  • logger
  • printf
  • tput
  • tr

However, we try to get as much as possible a standalone library. Hence, some of these external dependencies will be removed in the future.

Unit tests

BSFL uses Bats testing framework to verify the correct behaviour of its functions.

To run all the tests:

bats <BSFL repository>/test

Or, to run only the tests of a specific group:

bats <BSFL repository>/test/<test file>

For example, for the network group:

bats <BSFL repository>/test/network.bats

Releasing a new version

Below are the different steps to do before releasing a new version:

  • Run all tests and be sure they all pass
  • Update the BSFL_VERSION variable in lib/bsfl.sh
  • Update the PROJECT_NUMBER variable in doc/Doxygen
  • Update the Version variable in bsfl.spec
  • Update README.md if needed

Get involved!

This project is still under development. Contributions are welcomed.

License

New BSD

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.