Giter VIP home page Giter VIP logo

script-libs's Introduction

Work in progress

This repository is a collection of posix compliant shell scripts. The library management script libmgmt.sh provides a convenient method to load shell libraries. It assures that a library gets loaded only once also if it gets included multiple times. Therefore it is possible that two librarys can depend on each other without creating an endless loading loop.

Libraries

For more information please refer to the source code of the libraries. Every function has a header which explains its purpose and how to use it.

Library management (libmgmt.sh)

Contains functions to manage posix compliant shell script libraries

Dependency management (depmgmt.sh)

Contains functions to check for dependencies needed by other scripts and installs them if they are missing

User interaction (io.sh)

Library to interact with the user. It tries to use dialog, but defaults shell builtins if dialog is not available.

Common functions for WSL (wsl.sh)

Contains common function to work with Windows Subsystem for Linux (WSL)

Usage

  1. Install the libraries you want to use from the lib folder to the system on which you want to run the script or bundle them directly with your script. At the moment the following locations are valid: -- ./lib/ -- ../lib/ -- ~/.local/lib -- /usr/local/lib/ Make sure to also install the dependencies of the libraries you want to use, because some libraries depend on other libraries.
  2. Bundle the library management script and source it with . libmgmt.sh or include the code from libmgmt.sh directly within your script.
  3. Now you can load the libraries you want to use with libmgmt__load <lib_name>

Contributing

If you want to contribute please use the Google Shelle Style Guide as a coding standard with the following modifications:

  • Functions should be prefixed by the library name separated by __ from the function name
  • Global variables should be prefixed by the library name written all upper case and separated by _ from the variable name
  • Variables used locally in functions should be prefixed by the library library name written all lower case and separated by _ from the variable name
  • Variables used locally in a function should be unset before returning

script-libs's People

Watchers

 avatar  avatar

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.