Merge pull request #261 from lektor/lektor-619

[lektor-619] Fixing install.sh for breaking change in virtualenv
This commit is contained in:
Joseph Nix 2018-12-04 12:54:28 -06:00 committed by GitHub
commit cdfabbbab8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -24,7 +24,7 @@ if 1:
import json import json
import tempfile import tempfile
import shutil import shutil
from subprocess import Popen from subprocess import CalledProcessError, check_output, Popen
try: try:
from urllib.request import urlopen from urllib.request import urlopen
except ImportError: except ImportError:
@ -121,7 +121,10 @@ if 1:
os.makedirs(lib_dir) os.makedirs(lib_dir)
except OSError: except OSError:
pass pass
Popen([sys.executable, './virtualenv.py', lib_dir], cwd=t).wait() try:
check_output([sys.executable, './src/virtualenv.py', lib_dir], cwd=t)
except CalledProcessError: # virtualenv 16.1.0, 17+
Popen([sys.executable, './virtualenv.py', lib_dir], cwd=t).wait()
Popen([os.path.join(lib_dir, 'bin', 'pip'), Popen([os.path.join(lib_dir, 'bin', 'pip'),
'install', '--upgrade', 'Lektor']).wait() 'install', '--upgrade', 'Lektor']).wait()
os.symlink(os.path.join(lib_dir, 'bin', 'lektor'), os.symlink(os.path.join(lib_dir, 'bin', 'lektor'),