File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -85,23 +85,27 @@ q() {
8585}
8686
8787m () {
88+ prev_dir=" $( pwd) "
8889 r > /dev/null
8990
90- trap popd 1 2 3 6 > /dev/null
91-
9291 if [ ! -d .mscripts ]; then
93- echo " Unable to find .mscripts" && return 1
92+ echo " Unable to find .mscripts"
93+ cd " $prev_dir " > /dev/null || return 1
94+ return 1
9495 fi
96+
9597 script=" $1 "
9698 [ -n " $1 " ] && shift
97- mscript=" $( find .mscripts/ | tail -n+2 | xargs -n1 basename | fzf --query " $script " -1) "
99+ mscript=" $( find .mscripts/ -type f -executable | tail -n+2 | xargs -n1 basename | fzf --query " $script " -1) "
98100
99101 if [ -z " $mscript " ]; then
100102 echo " No mscript available for $script "
103+ cd " $prev_dir " > /dev/null
101104 return 1
102105 fi
103106
104107 eval .mscripts/" $mscript " $*
108+ cd " $prev_dir " > /dev/null
105109}
106110
107111mm () {
You can’t perform that action at this time.
0 commit comments