File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,16 +96,22 @@ m() {
9696
9797 script=" $1 "
9898 [ -n " $1 " ] && shift
99- mscript=" $( find .mscripts/ -type f -executable | tail -n+2 | xargs -n1 basename | fzf --query " $script " -1) "
99+
100+ # Need the funky find command below as we want to find all files or symlinks
101+ # \( ... \) groups expressions for logical precedence (escaped for the shell);
102+ # -type f: regular files; -type l: symlinks; -o: OR; -perm /111: any executable bit set
103+ mscript=" $( find .mscripts \( -type f -o -type l \) -perm /111 |
104+ tail -n+2 | xargs -n1 basename |
105+ fzf --query " $script " -1) "
100106
101107 if [ -z " $mscript " ]; then
102108 echo " No mscript available for $script "
103- cd " $prev_dir " > /dev/null
109+ cd " $prev_dir " > /dev/null || return 1
104110 return 1
105111 fi
106112
107113 eval .mscripts/" $mscript " $*
108- cd " $prev_dir " > /dev/null
114+ cd " $prev_dir " > /dev/null || return 1
109115}
110116
111117mm () {
You can’t perform that action at this time.
0 commit comments