Files
SwiftShell/Misc/swiftshell-init
2016-10-10 23:07:08 +02:00

27 lines
597 B
Bash
Executable File

#!/usr/bin/env bash
# Create a Swift Package Manager executable project structure and an Xcode project.
# exit at the first sign of trouble.
set -e
NAME=$1
mkdir $NAME
cd $NAME
swift package init --type executable
cat >> Package.swift <<_EOF_
package.dependencies.append(.Package(url: "https://github.com/kareman/SwiftShell.git", "3.0.0-beta"))
_EOF_
swift build
# Uncomment to automatically place a symbolic link to the compiled executable in a folder in your $PATH.
#ln -s `pwd`/.build/debug/$NAME <A FOLDER IN YOUR $PATH>/$NAME
swift package generate-xcodeproj
open $NAME.xcodeproj/