mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
Reuse pythonExecutable variable
This commit is contained in:
parent
1ac40b2673
commit
b7bd11a883
@ -2,7 +2,7 @@ var path = require('path');
|
||||
var fs = require('fs');
|
||||
var cp = require('child_process');
|
||||
var execFile = cp.execFile;
|
||||
var pythonPath = process.env.PYTHON;
|
||||
var pythonExecutable = process.env.PYTHON;
|
||||
|
||||
module.exports = function(cb) {
|
||||
verifyNode();
|
||||
@ -24,21 +24,17 @@ function verifyPython27(cb) {
|
||||
cb();
|
||||
}
|
||||
else {
|
||||
var pythonExecutable;
|
||||
if (!pythonPath) {
|
||||
if (!pythonExecutable) {
|
||||
var systemDrive = process.env.SystemDrive || 'C:\\';
|
||||
pythonPath = path.join(systemDrive, 'Python27');
|
||||
pythonExecutable = path.join(systemDrive, 'Python27');
|
||||
|
||||
if (fs.existsSync(pythonPath)) {
|
||||
pythonExecutable = path.join(pythonPath, 'python');
|
||||
if (fs.existsSync(pythonExecutable)) {
|
||||
pythonExecutable = path.join(pythonExecutable, 'python');
|
||||
}
|
||||
else {
|
||||
pythonExecutable = 'python';
|
||||
}
|
||||
}
|
||||
else {
|
||||
pythonExecutable = pythonPath;
|
||||
}
|
||||
|
||||
checkPythonVersion(pythonExecutable, cb);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user