diff options
author | Bryce Harrington <bryce@bryceharrington.org> | 2016-01-21 16:19:36 -0800 |
---|---|---|
committer | Bryce Harrington <bryce@bryceharrington.org> | 2016-01-21 16:41:37 -0800 |
commit | 90b2f9981991fb042615d12ac22b714d83ed3d42 (patch) | |
tree | 2e8d072acbc7b7a438d691580f64ef6d68660951 | |
parent | 4910b4a2a5a9ff5ee32c4aff5d2eec7973d078d2 (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-x | wl_clone | 37 |
1 files changed, 19 insertions, 18 deletions
@@ -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 |