Skip to content

Commit fa12fbd

Browse files
committed
add bulk shfmt check (pending mvdan/sh#952 to pass successfully)
1 parent 555bc5e commit fa12fbd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Runfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@ action :shellcheck do
3232
end
3333
end
3434

35+
help "Run shfmt checks on all examples"
36+
action :shfmt do
37+
Example.executables.each do |example|
38+
if File.exist? example
39+
success = system "shfmt -d -i 2 -ci #{example}"
40+
color = success ? 'txtgrn' : 'txtred'
41+
say "- shfmt !#{color}!#{example}"
42+
exit 1 unless success
43+
else
44+
say "- skip !txtcyn!#{example}"
45+
end
46+
end
47+
end
48+
3549
help "Generate changelog and append old changelog"
3650
action :changelog do
3751
system "git changelog --save"

0 commit comments

Comments
 (0)