Skip to content

Commit 921a01d

Browse files
committed
feat: check if tac, awk and sed commands exist on host
1 parent 13f7197 commit 921a01d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.github/workflows/pr-differences-mutants.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ jobs:
4646
input_file="git.diff"
4747
temp_file="temp_diff_file.diff"
4848
49+
# Check if the commands exist on the host
50+
for cmd in tac awk sed; do
51+
command -v "${cmd}" > /dev/null 2>&1 || echo "Missing command: ${cmd}"
52+
done
53+
4954
# Reverse the file, remove 4 lines after '+++ /dev/null', then reverse it back (editors can't go backwards - to remove lines above)
5055
tac "$input_file" > "$temp_file" && mv "$temp_file" "$input_file"
5156
sed '/+++ \/dev\/null/{n;N;N;N;d;}' "$input_file" > "$temp_file" && mv "$temp_file" "$input_file"

0 commit comments

Comments
 (0)