Skip to content

Commit

Permalink
Ensure install paths exist
Browse files Browse the repository at this point in the history
  • Loading branch information
jerearista committed Sep 9, 2015
1 parent e85cee6 commit 34f8ff2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ def install():
def join_url(x, y):
return '/' + '/'.join([z for z in x.split('/') + y.split('/') if z])

def ensure_dir(f):
d = os.path.dirname(f)
if not os.path.exists(d):
os.makedirs(d)

conf_path = config.CONF_PATH
install_path = config.INSTALL_PATH

Expand All @@ -64,7 +69,8 @@ def join_url(x, y):
print 'Customizing install for ReadTheDocs.org build servers...'
conf_path = '.' + conf_path
install_path = '.' + install_path
config.VERSION_FILE_PATH = '.' + config.VERSION_FILE_PATH
#config.VERSION_FILE_PATH = '.' + config.VERSION_FILE_PATH
os.environ('ZTPS_INSTALL_ROOT') = '.'
from subprocess import call
call(['docs/setup_rtd_files.sh'])
packages.append('client')
Expand Down Expand Up @@ -158,6 +164,8 @@ def join_url(x, y):
if install():
custom_path = os.environ.get('ZTPS_INSTALL_ROOT')
if custom_path:
shutil.copy('VERSION', join_url(custom_path, config.VERSION_FILE_PATH))
version_file = join_url(custom_path, config.VERSION_FILE_PATH)
else:
shutil.copy('VERSION', config.VERSION_FILE_PATH)
version_file = config.VERSION_FILE_PATH
ensure_dir(version_file)
shutil.copy('VERSION', version_file)

0 comments on commit 34f8ff2

Please sign in to comment.