diff --git a/linux.startproject.sh b/linux.startproject.sh deleted file mode 100755 index e440159..0000000 --- a/linux.startproject.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -set -e - -function usage { - echo "\n usage:\n ./startproject.sh \n" -} - -if [ "$1" == "" ]; then - usage - exit -fi - -echo "Starting project $1." - -cp -r template $1 -find $1 -type f | xargs sed -i "s/template/$1/" -mv $1/template $1/$1 - -echo "Create $1 succeed!" diff --git a/osx.startproject.sh b/startproject.sh similarity index 51% rename from osx.startproject.sh rename to startproject.sh index 8c8e174..2c46a53 100755 --- a/osx.startproject.sh +++ b/startproject.sh @@ -5,11 +5,19 @@ function usage { echo "\n usage:\n ./startproject.sh \n" } -if [ "$1" == "" ]; then +if [ "$1"X == ""X ]; then usage exit fi +if [ "$(uname)" == "Darwin" ]; then + alias sed='sed -i' +elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then + echo `uname -s` +elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then + echo `uname -s` +fi + echo "Starting project $1." cp -r template $1