Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A script that makes it easier to use the Swift Package Manager by making common commands less verbose 👍
#!/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
You can’t perform that action at this time.