-
-
Save JohnSundell/6f372850dc763cb5960fe45b91abd646 to your computer and use it in GitHub Desktop.
A script that makes it easier to use the Swift Package Manager by making common commands less verbose π
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
#!/usr/bin/env bash | |
# Put this file in /usr/local/bin and then run chmod +x on it to make it executable | |
command=$1 | |
shift | |
case $command in | |
"init" ) | |
swift package init "$@" | |
;; | |
"init-cli" ) | |
swift package init --type executable | |
;; | |
"update" ) | |
swift package update "$@" | |
;; | |
"build" ) | |
swift build "$@" | |
;; | |
"test" ) | |
swift test "$@" | |
;; | |
"run" ) | |
swift run "$@" | |
;; | |
"install" ) | |
PACKAGE=${PWD##*/} | |
swift build -c release -Xswiftc -static-stdlib | |
install .build/Release/$PACKAGE /usr/local/bin/$PACKAGE | |
;; | |
"manifest" ) | |
open Package.swift | |
;; | |
"xcode" ) | |
swift package generate-xcodeproj "$@" | |
open *.xcodeproj | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment