Files
swift-mirror/test/ParseableInterface/ModuleCache/Inputs/check-is-forwarding-module.py
Jordan Rose 140b3cc37c [test] Tweak check-is-forwarding-module.py to handle multiple inputs (#23313)
And fix the error message printing while I'm at it.

I don't have a public test for this at the moment, but an Apple-
internal tool will use it. I hope to upstream that tool in the future.
2019-03-14 17:55:49 -07:00

9 lines
295 B
Python

import sys
for input_path in sys.argv[1:]:
with open(input_path, 'r') as yaml_file:
# Forwarding files are YAML files that start with '---'
if yaml_file.read(3) != '---':
print("swiftmodule '%s' is not a forwarding module!" % input_path)
sys.exit(1)