Fixes #167 - On El Cap, detect Xcode 7 properly installed
This commit is contained in:
parent
55d076b805
commit
6aa7b57014
32
check_reqs.js
Executable file
32
check_reqs.js
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
var shell = require('shelljs');
|
||||||
|
var util = require('util');
|
||||||
|
var os = require('os');
|
||||||
|
|
||||||
|
var XCODEBUILD_MIN_VERSION = '6.4';
|
||||||
|
var XCODEBUILD_NOT_FOUND_MESSAGE =
|
||||||
|
'Please install Xcode version ' + XCODEBUILD_MIN_VERSION + ' or greater from App Store';
|
||||||
|
|
||||||
|
var tool = 'xcodebuild'
|
||||||
|
var tool_command = shell.which(tool);
|
||||||
|
if (!tool_command) {
|
||||||
|
console.log(tool + ' : ' + XCODEBUILD_NOT_FOUND_MESSAGE);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
shell.exec(tool + ' -version', { silent: true }, function(code, output) {
|
||||||
|
if (code === 0) {
|
||||||
|
var arr = output.match(/^Xcode (\d+\.\d+)/);
|
||||||
|
var ver = arr[1];
|
||||||
|
|
||||||
|
if (os.release() >= '15.0.0' && ver < '7.0') {
|
||||||
|
console.log(util.format('You need at least Xcode 7.0 on OS X 10.11 El Capitan (you have version %s)', ver));
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ver < XCODEBUILD_MIN_VERSION) {
|
||||||
|
console.log(util.format('%s : %s. (you have version %s)', tool, XCODEBUILD_NOT_FOUND_MESSAGE, ver));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
11
package.json
11
package.json
@ -1,17 +1,22 @@
|
|||||||
{
|
{
|
||||||
"name": "ios-deploy",
|
"name": "ios-deploy",
|
||||||
"version": "1.8.0",
|
"version": "1.8.0",
|
||||||
"os" : [ "darwin" ],
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
"description": "launch iOS apps iOS devices from the command line (Xcode 7)",
|
"description": "launch iOS apps iOS devices from the command line (Xcode 7)",
|
||||||
"main": "ios-deploy",
|
"main": "ios-deploy",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"preinstall": "make ios-deploy"
|
"preinstall": "./check_reqs.js && make ios-deploy"
|
||||||
},
|
},
|
||||||
"bin" : "./ios-deploy" ,
|
"bin": "./ios-deploy",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/phonegap/ios-deploy"
|
"url": "https://github.com/phonegap/ios-deploy"
|
||||||
},
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"shelljs": "^0.2.6"
|
||||||
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"ios-deploy",
|
"ios-deploy",
|
||||||
"deploy to iOS device"
|
"deploy to iOS device"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user