Code Monkey home page Code Monkey logo

gitleaks-pre-commit-hook's Introduction

Pre-commit Installation Script Manual

Overview

This script automates the installation of Python, pre-commit, and a specific pre-commit hook (check-yaml by default). The script can be configured to enable or disable the specified hook using git config. Additionally, it provides the option to be installed via the "curl ... | sh" method.

Usage

1. Install Script

To install the script using the "curl ... | sh" method, run the following command in your terminal:

curl -fsSL https://raw.githubusercontent.com/LawRider/gitleaks-pre-commit-hook/hook.sh | sh

2. Configuration

The script can be configured using git config to enable or disable the specified pre-commit hook.

Enable the Hook:

git config --global hooks.check-yaml.enable true

Disable the Hook:

git config --global hooks.check-yaml.enable false

3. Execution

The script will automatically detect whether Python is installed. If not, it will install Python based on your operating system.

If the specified pre-commit hook is enabled, the script will download pre-commit and configure the specified hook in the .pre-commit-config.yaml file. It will then install pre-commit and clean up temporary files.

4. Cleanup (if installed via "curl ... | sh")

If you've installed the script via "curl ... | sh" and want to remove the script after installation, the script will clean up itself. You don't need to manually remove it.

Notes

Make sure you have internet access during the installation process. The script is designed to be self-contained and cleans up after installation.

Examples

Install the script using "curl ... | sh"

curl -fsSL https://raw.githubusercontent.com/LawRider/gitleaks-pre-commit-hook/hook.sh | sh

Enable the specified pre-commit hook

git config --global hooks.check-yaml.enable true

Execute the script (it will install Python, pre-commit, and configure the specified hook)

The script will also clean up temporary files after installation

./hook.sh

Disable the specified pre-commit hook

git config --global hooks.check-yaml.enable false

gitleaks-pre-commit-hook's People

Contributors

lawrider 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.