Set file path for generated README.rst

README.rst could previously be generated by running readme.py only
from inside the scripts directory. This patch lets the script be run
from anywhere by taking the real path of the readme.py

Change-Id: Icd074bddbc9311b852e42be86d78c3dae82897d8
This commit is contained in:
Vinay Potluri 2017-02-02 23:19:36 -06:00
parent 697843eaa7
commit 45d507d6f5
1 changed files with 4 additions and 1 deletions

View File

@ -59,7 +59,10 @@ def find_docs():
def concat_docs():
"""Concatinates files yielded by the generator `find_docs`."""
outfile = "../README.rst"
file_path = os.path.dirname(os.path.realpath(__file__))
head, tail = os.path.split(file_path)
outfile = head +"/README.rst"
if not os.path.isfile(outfile):
print("../README.rst not found, exiting!")
exit(1)