Browse Source

Check if directory already exists

Bob Mottram 8 years ago
parent
commit
e76a9d4e0a
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      src/freedombone-app-tox

+ 5
- 3
src/freedombone-app-tox View File

@@ -469,9 +469,11 @@ function mesh_tox_node {
469 469
     if [ ! -d ${rootdir}${INSTALL_DIR} ]; then
470 470
         mkdir -p ${rootdir}${INSTALL_DIR}
471 471
     fi
472
-    git clone ${TOXCORE_REPO} ${rootdir}${INSTALL_DIR}/toxcore
473
-    if [ ! "$?" = "0" ]; then
474
-        exit 429252
472
+    if [ ! -d ${rootdir}${INSTALL_DIR}/toxcore ]; then
473
+        git clone ${TOXCORE_REPO} ${rootdir}${INSTALL_DIR}/toxcore
474
+        if [ ! "$?" = "0" ]; then
475
+            exit 429252
476
+        fi
475 477
     fi
476 478
     cd ${rootdir}$INSTALL_DIR/toxcore
477 479
     git checkout $TOXCORE_COMMIT -b $TOXCORE_COMMIT