Files
phonegap-plugins/iOS/bin/install
Randy McMillan 52c8156213 /bin commands
./install cloning to /iOSTEST works
./uninstall
2012-11-19 02:30:51 -05:00

71 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
set -e
help () {
cat<<EOF
Usage: install [help]
Commands:
help print this message
EOF
}
# create backup folder
if [ -e ~/backup/phonegap-plugins ]
then
echo 'backup phonegap-plugins folder exists'
else
mkdir -p ~/backup/phonegap-plugins
mkdir -p ~/backup/phonegap-plugins/iOSTEST
fi
#create ~/phonegap-plugins if doesnt exist
if [ -e ~/phonegap-plugins ]
then
echo 'phonegap-plugins folder exists'
else
mkdir -p ~/phonegap-plugins
fi
#create ~/phonegap-plugins/iOSTEST if doesnt exist
if [ -e ~/phonegap-plugins/iOSTEST ]
then
echo 'phonegap-plugins/iOSTEST folder exists'
else
mkdir -p ~/phonegap-plugins/iOSTEST
fi
bundles=$(cat ./bundles.txt)
cd ~/phonegap-plugins/iOSTEST
for repo in $bundles; do
echo $repo
git clone $repo
done
# Test for a valid arg and execute it if so; otherwise show the help
if [ "$1" != "" ]; then
wl=(help)
for i in "${wl[@]}"
do
if [ "$i" == "$1" ]
then
$1
exit 0
fi
done
fi
# show help
help
exit 0