From 05a46bd5b1bde9329a98f18c71596987916688b7 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Mon, 1 May 2017 01:34:58 -0400 Subject: Rewrite main module --- main.sh | 31 +++++++++++++++++++++++-------- make.sh | 2 +- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/main.sh b/main.sh index 0268643..cfec2f5 100644 --- a/main.sh +++ b/main.sh @@ -13,15 +13,30 @@ function main exit fi - if [[ "$1" == "checkout" ]]; then - systr_checkout $@ - elif [[ "$1" == "status" ]]; then - systr_status $@ - elif [[ "$1" == "commit" ]]; then - systr_commit $@ + cmd="$1" + shift + + if [ $# -gt 1 ]; then + if [[ "$cmd" == "checkout" ]]; then + systr_checkout "$@" + exit + fi + fi + + read remote <.systr/remote + read path <.systr/path + read BASE <.systr/BASE + read TRAC <.systr/TRAC + + if [[ "$cmd" == "checkout" ]]; then + systr_checkout "$@" + elif [[ "$cmd" == "status" ]]; then + systr_status "$@" + elif [[ "$cmd" == "commit" ]]; then + systr_commit "$@" else - echo "Error: $1 not recognized" + echo "Fatal: $1 not recognized" fi } -main $@ +main "$@" diff --git a/make.sh b/make.sh index d38c817..fb771a8 100755 --- a/make.sh +++ b/make.sh @@ -1,4 +1,4 @@ #!/usr/bin/bash echo "#!/usr/bin/bash -e" >systrunk -cat rsync.sh repo-access.sh repo-mutate.sh checkout.sh >>systrunk +cat rsync.sh repo-access.sh repo-mutate.sh checkout.sh main.sh >>systrunk chmod +x systrunk -- cgit v1.2.3