Last active
August 24, 2023 16:56
-
-
Save dpastoor/b4acfcd00836bd2ae56f04b755bb619d to your computer and use it in GitHub Desktop.
Revisions
-
dpastoor revised this gist
Aug 24, 2023 . 1 changed file with 22 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ #!/bin/bash url="https://github.com/evilmartians/lefthook/releases/download/v1.4.9/lefthook_1.4.9_Linux_x86_64" install_path="$HOME/.local/bin" binary_name="lefthook" # Create the installation directory if it doesn't exist mkdir -p "$install_path" # Download the binary echo "Downloading $binary_name..." curl -L "$url" -o "$install_path/$binary_name" # Add execute permissions chmod +x "$install_path/$binary_name" # Check if the binary is successfully installed if [ -x "$(command -v $binary_name)" ]; then echo "$binary_name is installed successfully at $install_path" else echo "Installation of $binary_name failed" fi -
dpastoor created this gist
Aug 22, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/bin/bash # Check if ~/.local/bin directory exists, if not, create it if [ ! -d "$HOME/.local/bin" ]; then mkdir -p "$HOME/.local/bin" echo "Created ~/.local/bin directory" fi # Check if ~/.profile file exists, if not, create it and add ~/.local/bin to PATH if [ ! -f "$HOME/.profile" ]; then touch "$HOME/.profile" echo "Created ~/.profile file" echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.profile" echo "Added ~/.local/bin to PATH in ~/.profile" else # Check if ~/.profile already contains the PATH modification, if not, add it if ! grep -q -F 'export PATH="$HOME/.local/bin:$PATH"' "$HOME/.profile"; then echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$HOME/.profile" echo "Added ~/.local/bin to PATH in ~/.profile" fi fi