Giter VIP home page Giter VIP logo

skn-shell-utils's Introduction

SKN Shell Script Utility Library

shell

Shell Script

GitHub Release MIT License

 

Introduction:

This is a simple Shell Script Utility Library

Since I use Linux, I made this library so that I can use it in all of my projects including in GitHub Action, Docker without writing the same codes over and over again

 

Details:

Basic Functions:

  • delete_directory (takes 1 argument)
  • delete_file (takes 1 argument)
  • copy_directory (takes 2 arguments)
  • copy_file (takes 2 arguments)
  • move_directory (takes 2 arguments)
  • move_file (takes 2 arguments)

Color Functions: Each takes 1 argument

  • black
  • black_bold
  • red
  • red_bold
  • green
  • green_bold
  • yellow
  • yellow_bold
  • blue
  • blue_bold
  • purple
  • purple_bold
  • cyan
  • cyan_bold
  • white
  • white_bold

Message Functions: Each takes 1 argument

  • show_action_completion_message
  • show_error_message
  • show_success_message
  • show_info_message

Package Functions: Each takes no argument

  • apt_prepare (updates, upgrades, autoremoves apt. Only for debian based linux distributions)
  • brew_prepare (updates, upgrades, autoremoves, cleans up Homebrew)

Spring Functions: Only for Spring Boot & good for GitHub Actions, Docker Images

  • build_jar (takes maximum 3 arguments for gradlew command)
  • copy_config_yaml (takes 1 argument)
  • run_jar (takes 1 argument)

 

Use Case:

  • Linux OS
  • MacOS

 

Usage:

To install, open the terminal & do the following

curl -sSL https://raw.githubusercontent.com/skn437/skn-shell-utils/master/build.sh | bash

Inside your shell script, you can import the scripts like this to get the library

source "${HOME}/.shell-lib/ssu/main.sh"

For Basic functions, use it like following

delete_directory "path to the directory"
delete_file "path to the file"
copy directory "path to the input directory" "path to the output directory"
copy_file "path to the input file" "path to the output file"
move_directory "path to the input directory" " path to the output directory"
move_file "path to the input file" "path to the output file"

For Color functions, use it like following

blue "message here"
red "message here"

For Message functions, use it like following

show_error_message "this message will be printed red with cross mark"
show_success_message "this message will be printed green with tick mark"
show_info_message "this message will be printed blue with book info mark"
show_action_completion_message "action name here"

For Package functions, use it like following

apt_prepare
brew_prepare

For Spring functions, use it like following

build_jar "command1" "command2" "command3"
run_jar "path to the jar file with file and its extension"
copy_config_yaml "path where the copied yaml file will be placed"

 

Dedicated To:

  • 👩‍🎨Prodipta Das Logno & 🧛‍♀️Atoshi Sarker Prithula: The two most special ladies of my life. I can't thank them enough for always treasuring me a lot. I am lucky that I met with these two amazing ladies. They have two special places in my heart and no other girl can ever replace them.
  • 💯My Parents: The greatest treasures of my life ever.

 

License:

Copyright (C) 2024 SKN Shukhan

Licensed under the MIT License

skn-shell-utils's People

Contributors

skn437 avatar

Stargazers

 avatar

Watchers

 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.