Last active
January 31, 2018 15:39
-
-
Save GeneralD/92df664394212345b3354da052103641 to your computer and use it in GitHub Desktop.
This file contains 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
# Mac Applications in 'Applications' directories -> runnable from the terminal | |
() { | |
local app dir | |
for dir in $@; do | |
for app in $dir/*.app(N); do; alias ${app:t:r:gs/ //}="open -a ${app:gs/ /\\ /}"; done | |
for app in $dir/*/*.app(N); do; alias ${app:t:r:gs/ //}="open -a ${app:gs/ /\\ /}"; done | |
done | |
} /Applications ~/Applications | |
# Open the directory with Finder (Open current directory without argument) | |
alias Finder='() {open ${1:-.} -a Finder}' | |
alias f=Finder | |
# if ‘Xcode-beta’ is selected Xcode, aliased to ‘Xcode’ | |
() { | |
local selected=${${$(xcode-select -p)%%.app/Contents*}##*/} | |
if [ $selected != "Xcode" ]; then | |
alias Xcode=$selected | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment