File tree 4 files changed +14
-6
lines changed
4 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ RUN apt update && \
186
186
expect `# For help50` \
187
187
file `# For help50` \
188
188
fonts-noto-color-emoji `# For render50` \
189
+ fzf `# For help50` \
189
190
gdb \
190
191
git \
191
192
git-lfs \
Original file line number Diff line number Diff line change @@ -81,7 +81,6 @@ function _help50() {
81
81
# Try to get help
82
82
for helper in $HELPERS /* ; do
83
83
if [[ -f $helper && -x $helper ]]; then
84
- echo " [$helper ]"
85
84
local help=$( $helper $argv <<< " $typescript" )
86
85
if [[ -n " $help " ]]; then
87
86
break
@@ -100,7 +99,7 @@ function _help50() {
100
99
}
101
100
102
101
function _question() {
103
- _alert " That was a rhetorical question. :) "
102
+ _alert " That was a rhetorical question. <3 "
104
103
}
105
104
106
105
# Default helpers
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ function _find() {
32
32
return
33
33
fi
34
34
35
- # Find $path in descendants of $WORKDIR, excluding hidden directories
35
+ # Find $path in descendants of $WORKDIR, excluding hidden directories, most recently modified first
36
36
paths=$(find "$WORKDIR" -not -path "*/.*" -name "$path" -printf "%T+ %p\n" $type | sort -nr | awk '{print $2}' 2> /dev/null)
37
37
38
38
# Count paths
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ if [[ "$output" =~ $regex ]]; then
67
67
fi
68
68
69
69
# touch foo.c && ./foo.c
70
- regex=" bash: \./(([^:] *)\.c): Permission denied"
70
+ regex=" bash: \./((. *)\.c): Permission denied"
71
71
if [[ " $output " =~ $regex ]]; then
72
72
73
73
# If file exists
@@ -77,6 +77,7 @@ if [[ "$output" =~ $regex ]]; then
77
77
fi
78
78
fi
79
79
80
+ # touch foo.py && ./foo.py
80
81
regex=" bash: \./(.*\.py): Permission denied"
81
82
if [[ " $output " =~ $regex ]]; then
82
83
@@ -87,11 +88,18 @@ if [[ "$output" =~ $regex ]]; then
87
88
fi
88
89
fi
89
90
91
+ # echo "int main(void) {}" > foo && ./foo
92
+ regex=" bash: \./([^\.]*): Permission denied"
93
+ if [[ " $output " =~ $regex ]]; then
94
+ if [[ $( file --brief --mime-type " ${BASH_REMATCH[1]} " ) == " text/x-c" ]]; then
95
+ echo " Did you mean to give \` " ${BASH_REMATCH[1]} " \` a name of \` " ${BASH_REMATCH[1]} " .c\` (and then compile it with \` make\` ) instead?"
96
+ exit
97
+ fi
98
+ fi
99
+
90
100
# touch foo && /.foo
91
101
regex=" bash: /\.([^:]*): No such file or directory"
92
102
if [[ " $output " =~ $regex ]]; then
93
-
94
- # If file exists
95
103
if [[ -f " ${BASH_REMATCH[1]} " ]]; then
96
104
echo " Did you mean to run \` ./${BASH_REMATCH[1]} \` ?"
97
105
exit
You can’t perform that action at this time.
0 commit comments