summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce Harrington <bryce@bryceharrington.org>2016-01-21 16:19:36 -0800
committerBryce Harrington <bryce@bryceharrington.org>2016-01-21 16:41:37 -0800
commit90b2f9981991fb042615d12ac22b714d83ed3d42 (patch)
tree2e8d072acbc7b7a438d691580f64ef6d68660951
parent4910b4a2a5a9ff5ee32c4aff5d2eec7973d078d2 (diff)
wl_clone: Bail out if WLROOT doesn't already exist
It's better for the user to be aware of where things are going to be built and installed.
-rwxr-xr-xwl_clone37
1 files changed, 19 insertions, 18 deletions
diff --git a/wl_clone b/wl_clone
index 49ff824..f98256c 100755
--- a/wl_clone
+++ b/wl_clone
@@ -8,34 +8,35 @@
clone_or_update() {
- repo=$1
- dest=$(basename $repo)
+ repo=$1
+ dest=$(basename $repo)
- if [ ! -d ${WLROOT} ]; then
- mkdir -p ${WLROOT}
- fi
- cd ${WLROOT}
- echo
- echo $dest
- if [ ! -d ${dest} ]; then
+ cd ${WLROOT}
+ if [ $? != 0 ]; then
+ echo "Error: Could not cd to ${WLROOT}. Does it exist?"
+ exit 1
+ fi
+ echo
+ echo $dest
+ if [ ! -d ${dest} ]; then
git clone ${repo} ${dest}
if [ $? != 0 ]; then
echo "Error: Could not clone repository"
exit 1
fi
- fi
- cd ${dest}
- git checkout master
- if [ $? != 0 ]; then
+ fi
+ cd ${dest}
+ git checkout master
+ if [ $? != 0 ]; then
echo "Error: Problem checking out master"
exit 1
- fi
- git pull
- if [ $? != 0 ]; then
+ fi
+ git pull
+ if [ $? != 0 ]; then
echo "Error: Could not pull from upstream"
exit 1
- fi
- cd ${WLROOT}
+ fi
+ cd ${WLROOT}
}
clone_or_update git://anongit.freedesktop.org/wayland/wayland