From bf3243aca6484d71d6fa655bf2dca67077c1bc6b Mon Sep 17 00:00:00 2001 From: Nathaniel Tucker Date: Tue, 10 Jan 2017 11:37:18 -0800 Subject: [PATCH] Check if autogenerated README exists, else use version tracked README --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ad156516..825dcc8e 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,10 @@ def rel(*parts): '''returns the relative path to a file wrt to the current directory''' return os.path.abspath(os.path.join(os.path.dirname(__file__), *parts)) -README = open('README.rst', 'r').read() +if os.path.isfile('README.rst'): + README = open('README.rst', 'r').read() +else: + README = open('README.md', 'r').read() with open(rel('webpack_loader', '__init__.py')) as handler: INIT_PY = handler.read()