-
Notifications
You must be signed in to change notification settings - Fork 0
/
make.sh
31 lines (26 loc) · 795 Bytes
/
make.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!bin/bash
while getopts w:gb: flag
do
case "${flag}" in
w) WORKDIR=${OPTARG};;
gb) GIT_BOSIS=${OPTARG};;
esac
done
[ -z "${WORKDIR}" ] && WORKDIR=$(mktemp -d -t demoXXXXXX)
[ -z "${GIT_BOSIS}" ] && GIT_BOSIS="https://github.com/sinkog/BaseOperationSystemInstallScripts.git"
cd ${WORKDIR}
### incude dependencies
if [ -d "BaseOperationSystemInstallScripts" ]; then
echo "git pull on the BaseOperationSystemInstallScripts directory"
if !(cd BaseOperationSystemInstallScripts && git pull && cd .. ;); then
echo "git pull failed" && exit 1
else
echo "pulled"
fi
else
echo "git clone BaseOperationSystemInstallScripts"
if !(git clone ${GIT_BOSIS} BaseOperationSystemInstallScripts); then
echo "git clone failed"
fi
fi
#bash nyers/create_vm.sh