Skip to content

Instantly share code, notes, and snippets.

@freddy1h
Last active May 5, 2025 19:07
Show Gist options
  • Save freddy1h/711062bc92911b3b96d3cea9a62101ea to your computer and use it in GitHub Desktop.
Save freddy1h/711062bc92911b3b96d3cea9a62101ea to your computer and use it in GitHub Desktop.
ZShell RC
# Open a Swift Package in the current directory
alias opk='open Package.swift'
# Open an Xcode project in the current directory
openproj() {
local proj
proj=$(find . -maxdepth 1 -name "*.xcodeproj" | head -n 1)
if [[ -n "$proj" ]]; then
open "$proj"
else
echo "No .xcodeproj file found in current directory."
fi
}
alias opp='openproj'
# Open an Xcode workspace in the current directory
openworkspace() {
local proj
proj=$(find . -maxdepth 1 -name "*.xcworkspace" | head -n 1)
if [[ -n "$proj" ]]; then
open "$proj"
else
echo "No .xcworkspace file found in current directory."
fi
}
alias opx='openworkspace'
# Terminate the Xcode app
alias px='pkill Xcode'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment