mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-13 21:44:40 -04:00
Testing for Python 2/3 before installing Node packages.
This commit is contained in:
parent
ea2392b2fe
commit
247db0c7f3
1 changed files with 8 additions and 1 deletions
|
@ -64,7 +64,14 @@ class RepositoryInstaller():
|
|||
#TODO: "Replace npm with more robust package
|
||||
#npm_location = self.config.directory.bin_directory + os.sep + "node" + os.sep + "bin" + os.sep + "npm"
|
||||
npm_location = u"npm"
|
||||
return_code = subprocess.call([npm_location,u"install"],cwd=self.config.directory.root_dir + os.sep + u"coco")
|
||||
if sys.version_info[0] == 2:
|
||||
py_cmd = "python"
|
||||
else:
|
||||
py_cmd = subprocess.check_output(['which', 'python2'])
|
||||
return_code = subprocess.call([npm_location, u"install",
|
||||
"--python=" + py_cmd],
|
||||
cwd=self.config.directory.root_dir +
|
||||
os.sep + u"coco")
|
||||
if return_code:
|
||||
raise errors.CoCoError(u"Failed to install node packages")
|
||||
else:
|
||||
|
|
Loading…
Add table
Reference in a new issue