File tree Expand file tree Collapse file tree 3 files changed +45
-9
lines changed
Expand file tree Collapse file tree 3 files changed +45
-9
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ unset locations
4+
5+ script_dir=" $1 "
6+ source " ${script_dir} /shellmenu.sh"
7+
8+ configfilename=.ezk-git-loca-conf
9+
10+ function toDirAndTerminate () {
11+ vars=" $* " # all splitted words back to one var
12+ blueLog " toDir $vars "
13+ eval " cd ${vars// / \\ } " # escape spaces
14+ nowaitonexit
15+ }
16+
17+ # Reads the config into global array "workspaces"
18+ # The config needs to have that section [workspaces]
19+ initConfig " ${script_dir} /EasyKey.git/${configfilename} "
20+
21+ echo " ${locations[@]} "
22+
23+ clear
24+ thekeys=($( echo {a..p}) $( echo {r..z}) $( echo {1..9}) $( echo {A..Z}) )
25+ declare -x keycounter=1
26+
27+ immediateMode=true
28+
29+ menuInit " Quick Locations"
30+ echo
31+ submenuHead " Registered locations:"
32+ OLD_IFS=$IFS
33+ for (( i = 1 ; i < (( ${# locations[@]} + 1 )) ; i++ )); do
34+ IFS=" =" read -r locname locdestination <<< " ${locations[i]}"
35+ menuItem " ${thekeys[keycounter]} " " $locdestination " " toDirAndTerminate ${locdestination} "
36+ (( keycounter++ ))
37+ done
38+ IFS=$OLD_IFS
39+ echo
40+ submenuHead " Shortcuts"
41+ menuItem X " Purge git dir cache" purgDirCache
42+ choice
43+
44+ unset locations
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -652,7 +652,7 @@ wait_for_keypress() {
652652initConfig () {
653653 # read config to global arrays
654654 INPUT=" $1 "
655- [ ! -f " $INPUT " ] && { echo " $INPUT file not found" ; exit 99 ; }
655+ [ ! -f " $INPUT " ] && { echo " Config file not found: $INPUT " ; wait_for_keypress ; }
656656 i=0
657657 configlines=$( cat " $INPUT " )
658658 while read -r configline; do
You can’t perform that action at this time.
0 commit comments