mirror of https://github.com/sbt/sbt.git
Adding github creation support.
This commit is contained in:
parent
592b4aca30
commit
1ce37d80bb
6
README
6
README
|
|
@ -1 +1,7 @@
|
|||
This is a skeleton project for sbt.
|
||||
|
||||
Simple usage:
|
||||
|
||||
bin/sbt-setup my-fancy-project
|
||||
|
||||
That's it. Start hacking.
|
||||
|
|
@ -9,6 +9,7 @@ declare -a args
|
|||
TEMPLATE="simple"
|
||||
SCALA_VERSION="2.8.1"
|
||||
PROJECT_VERSION="0.0.1"
|
||||
DO_GITHUB=
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
|
|
@ -25,6 +26,10 @@ while [ $# -gt 0 ]; do
|
|||
PROJECT_VERSION="$1"
|
||||
shift
|
||||
;;
|
||||
--github)
|
||||
shift
|
||||
DO_GITHUB="true"
|
||||
;;
|
||||
--28)
|
||||
SCALA_VERSION="2.8.1"
|
||||
shift
|
||||
|
|
@ -47,6 +52,7 @@ if [[ $# -ne 1 ]]; then
|
|||
cat <<EOM
|
||||
Usage: $(basename $0) [options] <project> [dependencies]
|
||||
|
||||
--hub create github project (requires hub and more)
|
||||
--simple use simple project template
|
||||
--fancy use multi-file project template
|
||||
--28 latest release of scala 2.8.x
|
||||
|
|
@ -163,5 +169,14 @@ git add -f project/plugins/Plugins.scala
|
|||
git commit -m "Initial Import for ${PROJECT_CC} (autogenerated by sbt-setup)."
|
||||
sbt update package test
|
||||
|
||||
if [[ $DO_GITHUB ]]; then
|
||||
GIT_URL="git@github.com:$(githubUser)/$PROJECT.git"
|
||||
echo Creating $GIT_URL
|
||||
hub create
|
||||
git config --local --add branch.master.remote origin
|
||||
git config --local --add branch.master.merge refs/heads/master
|
||||
git push origin master
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Ready to roll in $PWD"
|
||||
|
|
|
|||
|
|
@ -12,3 +12,11 @@ function camelCase () {
|
|||
|
||||
echo $1 | $SED -e 's/[-_]\([a-z]\)/\u\1/g' | $SED -e 's/^./\u&/;'
|
||||
}
|
||||
|
||||
function githubUser () {
|
||||
echo $(git config --global github.user)
|
||||
}
|
||||
|
||||
function githubToken () {
|
||||
echo $(git config --global github.token)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue