2017-12-20 15:52:34 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
|
|
# Header
|
|
|
|
|
contrib = ["""\
|
|
|
|
|
# Contributing to Project X-Ray
|
|
|
|
|
"""]
|
|
|
|
|
|
|
|
|
|
# Extract the "Contributing" section from README.md
|
|
|
|
|
found = False
|
|
|
|
|
for line in open('README.md'):
|
|
|
|
|
if found:
|
|
|
|
|
if line.startswith('# '):
|
|
|
|
|
# Found the next top level header
|
|
|
|
|
break
|
|
|
|
|
contrib.append(line)
|
|
|
|
|
else:
|
|
|
|
|
if line.startswith('# Contributing'):
|
|
|
|
|
found = True
|
|
|
|
|
|
|
|
|
|
# Footer
|
2018-01-09 23:45:26 +01:00
|
|
|
contrib.append(
|
|
|
|
|
"""\
|
2017-12-20 15:52:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
----
|
|
|
|
|
|
|
|
|
|
This file is generated from [README.md](README.md), please edit that file then
|
|
|
|
|
run the `./.update-contributing.py`.
|
|
|
|
|
|
|
|
|
|
""")
|
|
|
|
|
|
|
|
|
|
open("CONTRIBUTING.md", "w").write("".join(contrib))
|