New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@renault-digital/bash-base

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@renault-digital/bash-base

A common lib for creating bash script easily.

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-97.14%
Maintainers
2
Weekly downloads
 
Created
Source

Welcome to bash-base

License GitHub top language codecov GitHub Actions Status Conventional Commits semantic-release GitHub release npm package Docker Cloud Build Status GitHub commits since latest release

What's bash-base?

A common lib for creating bash script easily like other program language.

  • Rich functions to operate array/list/set/string/arguments/reflect/..., the functions can be used in console or script
  • Just call bash-base function by name in your script, like other programing language, no need anymore to search "how to ... in bash"
  • Parse and validation arguments easily & flexible, automatically generate help usage for your script, focus your script only on the business logical
  • Make your script more compact & readability
  • Available on github/npm/dockerhub

bash-base.gif

Latest Update

See CHANGELOG.md

How to use

1. Install from docker

See docker hub

source <(docker run --rm renaultdigital/bash-base)

Or specific a fixed version

source <(docker run --rm renaultdigital/bash-base:1.0.2)
2. Install from NPM

See npm repackage

npm install -g @renault-digital/bash-base

verify the installation

man bash-base

or one line in your script:

# import, and install bash-base from npmjs only if not installed:
source bash-base 2>/dev/null || npm install -g @renault-digital/bash-base && source bash-base

To uninstall:

npm uninstall -g @renault-digital/bash-base
3. Install from GitHub

The directory installed is ~/.bash-base.

install if not existed the specific version in console / shell script:
  • the man page of version v1.0.2: man bash-base.v1.0.2,
  • you can import this version in one line in your script:
source bash-base.v1.0.2 2>/dev/null || curl -o- -L https://raw.githubusercontent.com/renault-digital/bash-base/master/scripts/install.sh | bash -s -- v1.0.2"
If you always prefer to use the latest version, install if not existed the latest version in console / shell script:
  • the man page is: man bash-base,
  • and import like this:
source bash-base 2>/dev/null || curl -o- -L https://raw.githubusercontent.com/renault-digital/bash-base/master/scripts/install.sh | bash

or

source bash-base 2>/dev/null || curl -o- -L https://raw.githubusercontent.com/renault-digital/bash-base/master/scripts/install.sh | bash -s -- latest
Notes:

this way, your script will access github to check whether a newer version published during every time it launched. if you don't like this behavior, you need to specify a fixed version to use in your script.

If you want to check all functions of bash-base is compatible with your environment when install, using param verify :
source bash-base 2>/dev/null || curl -o- -L https://raw.githubusercontent.com/renault-digital/bash-base/master/scripts/install.sh | bash -s -- latest verify

or

source bash-base 2>/dev/null || curl -o- -L https://raw.githubusercontent.com/renault-digital/bash-base/master/scripts/install.sh | bash -s -- v1.0.2 verify
To uninstall all versions of bash-base from your system:
curl -o- -L https://raw.githubusercontent.com/renault-digital/bash-base/master/scripts/install.sh | bash -s -- uninstall
4. Import bash-base from GitHub when execute

Simply write in console or script:

If to import latest version:

source <(curl -fsSL https://raw.githubusercontent.com/renault-digital/bash-base/master/src/bash-base.sh)

or

eval "$(curl -fsSL https://raw.githubusercontent.com/renault-digital/bash-base/master/src/bash-base.sh)"

If to import specific version:

source <(curl -fsSL https://raw.githubusercontent.com/renault-digital/bash-base/v1.0.2/src/bash-base.sh)

or

eval "$(curl -fsSL https://raw.githubusercontent.com/renault-digital/bash-base/v1.0.2/src/bash-base.sh)

Verify the import in console:

string_trim ' hello '
Notes

this way, your script need to access github when each time it launched.

5. Download only

download a specific version:

Example

See example folder

Reference

See reference

Specification

See spec folder

Contributing

See How to contribute

License

MIT.

Keywords

FAQs

Package last updated on 09 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc