diff options
author | Malf Furious <m@lfurio.us> | 2017-09-05 03:39:39 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2017-09-05 03:39:39 -0400 |
commit | a3c2400aa991734812fc20616e60b6b8f746204c (patch) | |
tree | 78d3b414cc2e32ee3e92f7fdd4fed65fc53d59cd /main.sh | |
parent | fee8fe8f2f3969031ac6deb547763619f5b5710a (diff) | |
download | systrunk-a3c2400aa991734812fc20616e60b6b8f746204c.tar.gz systrunk-a3c2400aa991734812fc20616e60b6b8f746204c.zip |
Fix control flow in main()
Enable init to be run from outside worktrees. and also fixed some error
messages.
Diffstat (limited to 'main.sh')
-rw-r--r-- | main.sh | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -19,12 +19,18 @@ function main if [ ! -f ".systr/BASE" ]; then if [[ "$cmd" == "checkout" ]]; then systr_checkout "$@" - exit + elif [[ "$cmd" == "init" ]]; then + systr_init "$@" + else + echo "Fatal: not in a worktree" >&2 + exit 1 fi + + exit fi - read path <.systr/path || echo "Fatal: not in a worktree" >&2 - read BASE <.systr/BASE || exit 1 + read path <.systr/path + read BASE <.systr/BASE read TRAC <.systr/TRAC read MERG <.systr/MERG read updated <.systr/updated |