File tree Expand file tree Collapse file tree 1 file changed +24
-14
lines changed Expand file tree Collapse file tree 1 file changed +24
-14
lines changed Original file line number Diff line number Diff line change @@ -11,26 +11,36 @@ inputs:
11
11
runs :
12
12
using : " composite"
13
13
steps :
14
- - run : |
14
+ - name : Syntax check fish shell files
15
+ env :
16
+ PATTERN : ${{ inputs.pattern }}
17
+ run : |
15
18
set -gx TERM xterm-256color
16
19
17
20
set -l passes 0
18
21
set -l failures 0
19
22
20
- for file in ${{ inputs.pattern }}
21
- echo -n " "
22
- set output (fish --no-execute $file 2>&1)
23
- if test $status -ne 0
24
- set_color red; and echo -n "✖"; and set_color normal
25
- echo " $file"
26
- for line in (string split $output)
27
- echo " $line"
23
+ for pattern in (string split --no-empty -- " " $PATTERN)
24
+ set -l escaped (string escape --style=script --no-quoted -- $pattern)
25
+ set -l escaped (string replace -r -a -- '\\\([?*{}])' '$1' $escaped)
26
+
27
+ eval set -l files $escaped
28
+
29
+ for file in $files
30
+ echo -n " "
31
+ set output (fish --no-execute $file 2>&1)
32
+ if test $status -ne 0
33
+ set_color red; and echo -n "✖"; and set_color normal
34
+ echo " $file"
35
+ for line in (string split -- $output)
36
+ echo " $line"
37
+ end
38
+ set failures (math $failures + 1)
39
+ else
40
+ set_color green; and echo -n "✔"; and set_color normal
41
+ echo " $file"
42
+ set passes (math $passes + 1)
28
43
end
29
- set failures (math $failures + 1)
30
- else
31
- set_color green; and echo -n "✔"; and set_color normal
32
- echo " $file"
33
- set passes (math $passes + 1)
34
44
end
35
45
end
36
46
You can’t perform that action at this time.
0 commit comments