| 6 | |
| 7 | |
| 8 | def print_stderr(stderr, args): |
| 9 | if not args.github_actions: |
| 10 | sys.stderr.write(stderr + '\n') |
| 11 | return |
| 12 | |
| 13 | for line in stderr.split('\n'): |
| 14 | print(line) |
| 15 | parts = list(map(str.strip, line.split(':'))) |
| 16 | # e.g. luac prints "luac:" in front of messages, so find the first part |
| 17 | # containing the actual filename |
| 18 | for i in range(len(parts) - 1): |
| 19 | if parts[i].endswith('.' + args.ext) and parts[i + 1].isdigit(): |
| 20 | print('::error file=%s,line=%s::%s' % (parts[i], parts[i + 1], ':'.join(parts[i + 2:]))) |
| 21 | break |
| 22 | |
| 23 | |
| 24 | def main(args): |