GithubHelp home page GithubHelp logo

foldright / bash-buddy Goto Github PK

View Code? Open in Web Editor NEW
11.0 1.0 1.0 178 KB

๐Ÿšผ Bash Buddy(aka. BaBy) contains bash libs and tools that extracted from CI scripts of my projects.

Home Page: https://github.com/foldright/bash-buddy

License: Apache License 2.0

Shell 100.00%
bash bash-buddy buddy baby ci continuous-integration java maven sdkman automation

bash-buddy's Introduction

๐Ÿšผ Bash Buddy

License GitHub release GitHub Stars GitHub Forks GitHub issues GitHub repo size

๐Ÿšผ Bash Buddy(aka. BaBy) contains bash libs and tools that extracted from CI scripts of my projects.



๐Ÿ—‚ Lib

a common lib to show trapped error info including stack trace.

provide function trap_error_info::register_show_error_info_handler to register the error-trap handler which show error info when trapped error.

by default, auto call trap_error_info::register_show_error_info_handler when source this script; disable by define TRAP_ERROR_NO_AUTO_REGISTER var.

api functions:

  • trap_error_info::get_stack_trace
  • trap_error_info::register_show_error_info_handler

common util functions.

use short namespace cu, since these functions will be used frequently.

api functions:

  • simple color print functions:
    • cu::red_echo
    • cu::yellow_echo
    • cu::blue_echo
    • cu::head_line_echo
  • validation functions:
    • cu::is_number_string
    • cu::is_blank_string
  • version related functions:
    • cu::version_le
    • cu::version_lt
    • cu::version_ge
    • cu::version_gt
    • cu::is_version_match
    • cu::get_latest_version_match
    • cu::get_oldest_version_match
  • execution helper functions:
    • cu::log_then_run
    • cu::loose_run
    • cu::print_calling_command_line
    • cu::die

java util functions.

api functions:

  • jvu::get_java_version
  • jvu::switch_to_jdk
  • jvu::java_cmd

maven util functions for build.

api functions:

  • maven operation functions:
    • mvu::mvn_cmd

a lib to prepare jdks by sdkman.

api functions:

  • prepare_jdks::switch_to_jdk
  • prepare_jdks::prepare_jdks
  • prepare_jdks::install_jdk_by_sdkman
  • prepare_jdks::load_sdkman
  • prepare_jdks::install_sdkman

โš’๏ธ Tool

Generate source guard to bash lib scripts.

Example:

$ gen_source_guard
#_ source guard begin _#
[ -z "${__source_guard_0EDD6400_96EC_43E4_871A_E65F6781B828:+has_value}" ] || return 0
__source_guard_0EDD6400_96EC_43E4_871A_E65F6781B828="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
readonly __source_guard_0EDD6400_96EC_43E4_871A_E65F6781B828
#_ source guard end _#

bash-buddy's People

Contributors

oldratlee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

swwang1

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.