@@ -67,13 +67,13 @@ https://github.com/${GITHUB_REPOSITORY}/blob/${GITHUB_SHA}/${PUZZLE_FILE}#L${PUZ
67
67
Tech debt for: $GITHUB_SHA (#$ORIG_ISSUE)"'
68
68
69
69
DIR=" $( dirname " $1 " ) "
70
- MAPPING_FILE =" $DIR /todos-on-github.tsv"
70
+ ISSUES_MAPPING_FILE =" $DIR /todos-on-github.tsv"
71
71
72
- if [ ! -f " $MAPPING_FILE " ]; then
73
- info " $MAPPING_FILE doesn't exist. Creating..."
74
- printf ' Id\tIssue\tState\tCreated\n' >> " $MAPPING_FILE "
72
+ if [ ! -f " $ISSUES_MAPPING_FILE " ]; then
73
+ info " $ISSUES_MAPPING_FILE doesn't exist. Creating..."
74
+ printf ' Id\tIssue\tState\tCreated\n' >> " $ISSUES_MAPPING_FILE "
75
75
else
76
- info " $MAPPING_FILE exists"
76
+ info " $ISSUES_MAPPING_FILE exists"
77
77
fi
78
78
79
79
[ -f " $DIR /todos-in-code.tsv" ] || fatal " $DIR /todos-in-code.tsv doesn't exists!"
@@ -92,7 +92,7 @@ while IFS=$'\t' read -r PUZZLE_ID UNUSED_TICKET TITLE UNUSED_REST; do
92
92
TITLE=" $( echo " $TITLE " | sed -e ' s|^"||;' -e ' s|"$||' -e ' s|""|"|g' ) "
93
93
94
94
debug " $PUZZLE_ID : has title: '$TITLE '"
95
- MAPPING=" $( grep --max-count=1 " ^${PUZZLE_ID} [[:space:]]" " $MAPPING_FILE " || :) "
95
+ MAPPING=" $( grep --max-count=1 " ^${PUZZLE_ID} [[:space:]]" " $ISSUES_MAPPING_FILE " || :) "
96
96
if [ -n " $MAPPING " ]; then
97
97
IFS=$' \t ' read -r UNUSED_PUZZLE_ID ISSUE_ID UNUSED_REST <<< " $MAPPING"
98
98
info " $PUZZLE_ID => #$ISSUE_ID : is already linked"
@@ -149,7 +149,7 @@ while IFS=$'\t' read -r PUZZLE_ID UNUSED_TICKET TITLE UNUSED_REST; do
149
149
# UNUSED_REST is really unused but without it, read appends the rest of a line to the last variable
150
150
# shellcheck disable=SC2034
151
151
echo " $CANDIDATES " | while read -r ISSUE_ID ISSUE_STATE UNUSED_REST; do
152
- error " echo '$PUZZLE_ID \t$ISSUE_ID \t$ISSUE_STATE \tmanually' >>$MAPPING_FILE "
152
+ error " echo '$PUZZLE_ID \t$ISSUE_ID \t$ISSUE_STATE \tmanually' >>$ISSUES_MAPPING_FILE "
153
153
done
154
154
fatal ' '
155
155
fi
@@ -178,7 +178,7 @@ while IFS=$'\t' read -r PUZZLE_ID UNUSED_TICKET TITLE UNUSED_REST; do
178
178
info " $PUZZLE_ID => #$ISSUE_ID : issue has been created: $ISSUE_LINK "
179
179
180
180
info " $PUZZLE_ID => #$ISSUE_ID : link with $ISSUE_ID (just created)"
181
- printf ' %s\t%s\topen\tautomatically\n' " $PUZZLE_ID " " $ISSUE_ID " >> " $MAPPING_FILE "
181
+ printf ' %s\t%s\topen\tautomatically\n' " $PUZZLE_ID " " $ISSUE_ID " >> " $ISSUES_MAPPING_FILE "
182
182
NEW_ISSUES_COUNT=$(( NEW_ISSUES_COUNT + 1 ))
183
183
continue
184
184
fi
@@ -226,14 +226,14 @@ while IFS=$'\t' read -r PUZZLE_ID UNUSED_TICKET TITLE UNUSED_REST; do
226
226
error " Ways to resolve:"
227
227
error " 1) edit $ISSUE_URL and modify its body to contain $PUZZLE_ID "
228
228
error " 2) manually create a mapping between this puzzle and the issue:"
229
- error " echo '$PUZZLE_ID \t$ISSUE_ID \t$ISSUE_STATE \tmanually' >>$MAPPING_FILE "
229
+ error " echo '$PUZZLE_ID \t$ISSUE_ID \t$ISSUE_STATE \tmanually' >>$ISSUES_MAPPING_FILE "
230
230
fatal ' '
231
231
else
232
232
debug " $PUZZLE_ID => #$ISSUE_ID : body contains puzzle id"
233
233
fi
234
234
235
235
info " $PUZZLE_ID => #$ISSUE_ID : link with $ISSUE_ID ($ISSUE_STATE )"
236
- printf ' %s\t%s\t%s\tautomatically\n' " $PUZZLE_ID " " $ISSUE_ID " " $ISSUE_STATE " >> " $MAPPING_FILE "
236
+ printf ' %s\t%s\t%s\tautomatically\n' " $PUZZLE_ID " " $ISSUE_ID " " $ISSUE_STATE " >> " $ISSUES_MAPPING_FILE "
237
237
fi
238
238
done <<< " $(grep -v '^Id' " $1 " )"
239
239
0 commit comments