Commit 27009c13 authored by Tushar Shah's avatar Tushar Shah

indent

parent 03f5fd0c
...@@ -1244,24 +1244,24 @@ jobs: ...@@ -1244,24 +1244,24 @@ jobs:
name: Filter comments and match only 1 script name: Filter comments and match only 1 script
command: | command: |
SCRIPT=$(cat <<'EOF' SCRIPT=$(cat <<'EOF'
BEGIN { in_comment = 0; matches = 0; } BEGIN { in_comment = 0; matches = 0; }
/^ *\/\*/ { in_comment = 1; } /^ *\/\*/ { in_comment = 1; }
in_comment && /\*\// { in_comment = 0; next; } in_comment && /\*\// { in_comment = 0; next; }
!in_comment && !/^ *\/\// && /PATTERN/ { matches++; matched_line = $0; } !in_comment && !/^ *\/\// && /PATTERN/ { matches++; matched_line = $0; }
END { END {
if (matches == 1) { if (matches == 1) {
print matched_line; print matched_line;
} else if (matches > 1) { } else if (matches > 1) {
print "Multiple matches found. Exiting."; print "Multiple matches found. Exiting.";
exit 1; exit 1;
} else { } else {
print "No matches found. Exiting."; print "No matches found. Exiting.";
exit 1; exit 1;
} }
} }
EOF EOF
) )
echo "export SCRIPT=$SCRIPT" >> $BASH_ENV echo "export SCRIPT=$SCRIPT" >> $BASH_ENV
- run: - run:
name: Extract value from file1 name: Extract value from file1
command: | command: |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment