Created
April 26, 2025 16:30
-
-
Save Hamatti/0b714377d1c45427d931a7a3166a673e to your computer and use it in GitHub Desktop.
A script to make scripts runnable and symbolically linked to /usr/local/bin in zsh
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 characters
#!/bin/zsh | |
script=$1 | |
scriptname=$(basename $script) | |
echo "Making $scriptname executable..." | |
chmod +x $script | |
echo "Linking $scriptname to /usr/local/bin..."; | |
ln -s "$PWD/$script" "/usr/local/bin/$scriptname" # $PWD is needed since it requires an absolute path for the link to work. | |
rehash # Needed to update zsh cache for new scripts for autocomplete. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment