diff options
author | Rafael Brandao <rafael.lobo@openbossa.org> | 2012-07-18 16:42:04 -0300 |
---|---|---|
committer | Rafael Brandao <rafael.lobo@openbossa.org> | 2012-07-18 16:48:01 -0300 |
commit | febc125e690a73d9125e7182203c4651047630c5 (patch) | |
tree | 443faed07bc85da80f8a6b012fe082dae41aac3e | |
parent | d1b302acf9d923eab869426ab8756c9282e2e747 (diff) | |
download | snowshoe-febc125e690a73d9125e7182203c4651047630c5.tar.gz |
Improve deploy script to support username
I've also added a protection in case you run the script
from the snowshoe/tools folder.
Reviewed-by: Lauro Moura
-rwxr-xr-x | tools/build-deploy.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tools/build-deploy.sh b/tools/build-deploy.sh index 01e91aa..00e0842 100755 --- a/tools/build-deploy.sh +++ b/tools/build-deploy.sh @@ -3,10 +3,14 @@ SBOX_HOME=/scratchbox/users/$USER/home/$USER PROJECTFOLDER_HOST=$(pwd -P) +if [ $(basename $PROJECTFOLDER_HOST) = "tools" ]; then + PROJECTFOLDER_HOST=$(cd .. && pwd -P) +fi # Options PROJECTFOLDER=$(basename $PROJECTFOLDER_HOST)-tmp IP=192.168.2.15 +USERNAME="developer" # Flags BUILD_ONLY=0 @@ -25,15 +29,17 @@ Options:\n -d\t\t\tgenerate debian package instead of single executable\n -h\t\t\tshows this help message.\n -i IP\t\t\tip of the target N9/N950 device\n +-u USERNAME\t\tset username to connect\n -p FOLDER\t\tname of the temporary folder\n -r\t\t\trun the executable after copying (without -b) " -while getopts p:i:bdrch ARG +while getopts p:i:u:bdrch ARG do case "$ARG" in p) PROJECTFOLDER="$OPTARG";; i) IP="$OPTARG";; + u) USERNAME="$OPTARG";; b) BUILD_ONLY=1;; d) DEBIAN=1;; r) RUN=1;; @@ -44,8 +50,8 @@ esac done # N9 configuration. This is the default ip for USB connections. -N9=developer@$IP -N9HOME=/home/developer +N9=$USERNAME@$IP +N9HOME=/home/$USERNAME # Sync with build folder echo "rsync $PROJECTFOLDER_HOST to $SBOX_HOME/$PROJECTFOLDER" |