From 7d7b46ba21611423832136a77928400e770c26af Mon Sep 17 00:00:00 2001 From: jedi Date: Fri, 31 Jan 2020 22:39:18 +0100 Subject: [PATCH] wip --- unbox.sh | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/unbox.sh b/unbox.sh index 6a5b90f..133f43f 100755 --- a/unbox.sh +++ b/unbox.sh @@ -8,18 +8,23 @@ function unbox_outer_stage(){ apt install git util-linux - touch .repo_cache - select chosen_repo in other $(cat .repo_cache | sort | uniq); do - if [ "${chosen_repo}" = "other" ]; then - echo -n "git repository url: " - read REMOTE - else - REMOTE=$chosen_repo - fi - echo $REMOTE - echo $REMOTE >> .repo_cache - break - done + if [ -e .repo_cache ]; then + select chosen_repo in other $(cat .repo_cache | sort | uniq); do + if [ "${chosen_repo}" = "other" ]; then + echo -n "git repository url: " + read REMOTE + else + REMOTE=$chosen_repo + fi + break + done + else + echo -n "git repository url: " + read REMOTE + fi + + echo $REMOTE + echo $REMOTE >> .repo_cache if [ -e repo ]; then (cd repo; git pull)