mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 15:37:46 +03:00
Update error messages
This commit is contained in:
parent
b7bd11a883
commit
99af9e2c33
@ -41,27 +41,29 @@ function verifyPython27(cb) {
|
||||
}
|
||||
|
||||
function checkPythonVersion (python, cb) {
|
||||
var pythonRequiredMessage = "Python 2.7 is required to build Atom. Python 2.7 must be installed at '" + pythonPath + "', or the PYTHON env var must be set to '/path/to/Python27/python.exe', or the Python install directory must be in the path.";
|
||||
var pythonHelpMessage = "Set the PYTHON env var to '/path/to/Python27/python.exe' if your python is installed in a non-default location.";
|
||||
|
||||
execFile(python, ['-c', 'import platform; print(platform.python_version());'], { env: process.env }, function (err, stdout) {
|
||||
if (err) {
|
||||
console.log(pythonRequiredMessage);
|
||||
console.log("Python 2.7 is required to build Atom. An error occured when checking for python '" + err + "'");
|
||||
console.log(pythonHelpMessage);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
var version = stdout.trim()
|
||||
var version = stdout.trim();
|
||||
if (~version.indexOf('+')) {
|
||||
version = version.replace(/\+/g, '')
|
||||
version = version.replace(/\+/g, '');
|
||||
}
|
||||
if (~version.indexOf('rc')) {
|
||||
version = version.replace(/rc(.*)$/ig, '')
|
||||
version = version.replace(/rc(.*)$/ig, '');
|
||||
}
|
||||
|
||||
// Atom requires python 2.7 or better (but not python 3) for node-gyp
|
||||
// Atom requires python 2.7 or higher (but not python 3) for node-gyp
|
||||
var versionArray = version.split('.').map(function(num) { return +num; });
|
||||
var goodPythonVersion = (versionArray[0] === 2 && versionArray[1] >= 7)
|
||||
var goodPythonVersion = (versionArray[0] === 2 && versionArray[1] >= 7);
|
||||
if (!goodPythonVersion) {
|
||||
console.log(pythonRequiredMessage);
|
||||
console.log("Python 2.7 is required to build Atom. '" + python + "' returns version " + version);
|
||||
console.log(pythonHelpMessage);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user