Created
November 4, 2019 16:27
-
-
Save vyshane/e144c502e2006761949741b29d9c6fa2 to your computer and use it in GitHub Desktop.
Quickly generate a new Xcode project using Swift Package Manager, and open the project's main.swift in the Xcode editor
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/sh | |
# | |
# Quickly generate a new Xcode project using Swift Package Manager, | |
# and open the project's main.swift in the Xcode editor. | |
pwd=$(pwd) | |
mkdir $1 | |
cd $1 | |
swift package init | |
rm ./Sources/$1/$1.swift | |
echo "print(\"Hello world\")" > ./Sources/$1/main.swift | |
swift package generate-xcodeproj | |
open -F -a Xcode ./$1.xcodeproj | |
sleep 1 | |
osascript \ | |
-e 'tell application "Xcode"' \ | |
-e "open POSIX file \"$pwd/$1/Sources/$1/main.swift\"" \ | |
-e 'end tell' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment