blob: a175f18410103af840f347ec2ea20f08b335b740 [file] [log] [blame]
onqtam5cab8e92016-10-10 17:58:38 +03001#!/usr/bin/python2.7
2
3import subprocess
4import fileinput
5
6# update main readme 'try it online' badge permalink
7print("updating main readme with up-to-date wandbox link")
8proc = subprocess.Popen('python send_to_wandbox.py ../doctest/ ' + "../examples/hello_world/main.cpp", stdout = subprocess.PIPE)
9url = proc.stdout.read().strip()
10
11readme_contents = ""
12for line in fileinput.input(["../README.md"]):
13 if line.startswith("[![Try it online]"):
14 readme_contents += "[![Try it online](https://img.shields.io/badge/try%20it-online-orange.svg)](" + url + ")\n"
15 else:
16 readme_contents += line
17
18readme = open("../README.md", "w")
19readme.write(readme_contents)
20readme.close()