Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

appium-xcode

Package Overview
Dependencies
Maintainers
4
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appium-xcode - npm Package Compare versions

Comparing version 3.5.0 to 3.6.0

.github/ISSUE_TEMPLATE.md

49

build/lib/xcode.js

@@ -29,2 +29,6 @@ 'use strict';

var _semver = require('semver');
var _semver2 = _interopRequireDefault(_semver);
var env = process.env;

@@ -225,3 +229,3 @@

var timeout = arguments.length <= 0 || arguments[0] === undefined ? XCRUN_TIMEOUT : arguments[0];
var xcodePath, plistPath, version, versionPattern, match;
var xcodePath, plistPath, version;
return _regeneratorRuntime.async(function getVersionWithoutRetry$(context$1$0) {

@@ -253,15 +257,5 @@ while (1) switch (context$1$0.prev = context$1$0.next) {

version = context$1$0.sent;
return context$1$0.abrupt('return', _semver2['default'].coerce(version.CFBundleShortVersionString));
version = version.CFBundleShortVersionString;
versionPattern = /\d\.\d\.*\d*/;
match = version.match(versionPattern);
if (match === null || !_appiumSupport.util.hasContent(match[0])) {
log.errorAndThrow('Could not parse Xcode version. xcodebuild output was: ' + version);
}
return context$1$0.abrupt('return', match[0]);
case 16:
case 12:
case 'end':

@@ -284,3 +278,3 @@ return context$1$0.stop();

var timeout = arguments.length <= 2 || arguments[2] === undefined ? XCRUN_TIMEOUT : arguments[2];
var version, match;
var version, versionString;
return _regeneratorRuntime.async(function getVersion$(context$1$0) {

@@ -294,18 +288,18 @@ while (1) switch (context$1$0.prev = context$1$0.next) {

version = context$1$0.sent;
versionString = version.patch > 0 ? version.version : version.major + '.' + version.minor;
if (parse) {
context$1$0.next = 5;
context$1$0.next = 6;
break;
}
return context$1$0.abrupt('return', version);
return context$1$0.abrupt('return', versionString);
case 5:
match = /^(\d+)\.(\d+)(\.(\d+))?$/.exec(version);
case 6:
return context$1$0.abrupt('return', {
versionString: version,
versionFloat: parseFloat(match[1] + '.' + match[2]),
major: parseInt(match[1], 10),
minor: parseInt(match[2], 10),
patch: match[4] ? parseInt(match[4], 10) : undefined
versionString: versionString,
versionFloat: parseFloat(versionString),
major: version.major,
minor: version.minor,
patch: version.patch > 0 ? version.patch : undefined
});

@@ -738,8 +732,5 @@

// need to use string#match here; previous code used regexp#exec, which does not return null
// xcode version strings are not exactly semver string: patch versions of 0
// are removed (e.g., '10.0.0' => '10.0')
// match should be an array, either of
// [ '7.0', '7', '0', undefined, undefined, index: 0, input: '7.0' ]
// [ '7.0.1', '7', '0', '.1', '1', index: 0, input: '7.0.1' ]
// there are a number of different ways that the CLI tools version has been

@@ -753,2 +744,2 @@ // represented. Try them from most reliable to least, falling down the chain

// rather than waste time getting the iOSSDKVersion, just get both paths and see which one exists
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImxpYi94Y29kZS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7NkJBQXdDLGdCQUFnQjs7b0JBQ3ZDLE1BQU07Ozs7d0JBQ0QsVUFBVTs7c0JBQ2xCLFFBQVE7Ozs7cUJBQ2tCLE9BQU87OzRCQUMxQixjQUFjOztBQUduQyxJQUFNLEdBQUcsR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDOztBQUV4QixJQUFNLGFBQWEsR0FBRyxLQUFLLENBQUM7QUFDNUIsSUFBTSxZQUFZLEdBQUcscUJBQXFCLENBQUM7QUFDM0MsSUFBTSx5QkFBeUIsR0FBRyxDQUFDLENBQUM7O0FBRXBDLElBQU0sR0FBRyxHQUFHLHNCQUFPLFNBQVMsQ0FBQyxPQUFPLENBQUMsQ0FBQzs7QUFHdEMsU0FBUyxpQkFBaUIsQ0FBRSxJQUFJLEVBQUU7QUFDaEMsU0FBTyxJQUFJLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxNQUFNLEdBQUcsWUFBWSxDQUFDLE1BQU0sQ0FBQyxL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XRJbnN0cnVtZW50c1BhdGgsXG4gICAgICAgICBnZXRDb21tYW5kTGluZVRvb2xzVmVyc2lvbiwgZ2V0TWF4VFZPU1NESywgZ2V0TWF4VFZPU1NES1dpdGhvdXRSZXRyeSB9O1xuIl0sInNvdXJjZVJvb3QiOiIuLi8uLiJ9

@@ -7,2 +7,3 @@ import { util, fs, plist, logger } from 'appium-support';

import { exec } from 'teen_process';
import semver from 'semver';

@@ -110,3 +111,3 @@

async function getVersionWithoutRetry (timeout = XCRUN_TIMEOUT) {
let xcodePath = await getPath(timeout);
const xcodePath = await getPath(timeout);

@@ -121,13 +122,4 @@ // we want to read the CFBundleShortVersionString from Xcode's plist.

let version = await plist.parsePlistFile(plistPath);
version = version.CFBundleShortVersionString;
let versionPattern = /\d\.\d\.*\d*/;
// need to use string#match here; previous code used regexp#exec, which does not return null
let match = version.match(versionPattern);
if (match === null || !util.hasContent(match[0])) {
log.errorAndThrow(`Could not parse Xcode version. xcodebuild output was: ${version}`);
}
return match[0];
const version = await plist.parsePlistFile(plistPath);
return semver.coerce(version.CFBundleShortVersionString);
}

@@ -142,16 +134,16 @@

async function getVersion (parse = false, retries = DEFAULT_NUMBER_OF_RETRIES, timeout = XCRUN_TIMEOUT) {
let version = await getVersionMemoized(retries, timeout);
const version = await getVersionMemoized(retries, timeout);
// xcode version strings are not exactly semver string: patch versions of 0
// are removed (e.g., '10.0.0' => '10.0')
const versionString = version.patch > 0 ? version.version : `${version.major}.${version.minor}`;
if (!parse) {
return version;
return versionString;
}
let match = /^(\d+)\.(\d+)(\.(\d+))?$/.exec(version);
// match should be an array, either of
// [ '7.0', '7', '0', undefined, undefined, index: 0, input: '7.0' ]
// [ '7.0.1', '7', '0', '.1', '1', index: 0, input: '7.0.1' ]
return {
versionString: version,
versionFloat: parseFloat(`${match[1]}.${match[2]}`),
major: parseInt(match[1], 10),
minor: parseInt(match[2], 10),
patch: match[4] ? parseInt(match[4], 10) : undefined
versionString,
versionFloat: parseFloat(versionString),
major: version.major,
minor: version.minor,
patch: version.patch > 0 ? version.patch : undefined
};

@@ -158,0 +150,0 @@ }

@@ -9,3 +9,3 @@ {

],
"version": "3.5.0",
"version": "3.6.0",
"author": "appium",

@@ -34,2 +34,3 @@ "license": "Apache-2.0",

"plist": "^3.0.1",
"semver": "^5.5.0",
"source-map-support": "^0.5.5",

@@ -68,3 +69,16 @@ "teen_process": "^1.3.0"

"pre-commit": "^1.1.3"
},
"greenkeeper": {
"ignore": [
"babel-eslint",
"babel-preset-env",
"eslint",
"eslint-plugin-babel",
"eslint-plugin-import",
"eslint-plugin-mocha",
"eslint-plugin-promise",
"gulp",
"babel-runtime"
]
}
}
appium-xcode
===================
[![NPM version](http://img.shields.io/npm/v/appium-xcode.svg)](https://npmjs.org/package/appium-xcode)
[![NPM version](http://img.shields.io/npm/v/appium-xcode.svg)](https://npmjs.org/package/appium-xcode)
[![Downloads](http://img.shields.io/npm/dm/appium-xcode.svg)](https://npmjs.org/package/appium-xcode)
[![Dependency Status](https://david-dm.org/appium/appium-xcode.svg)](https://david-dm.org/appium/appium-xcode)
[![devDependency Status](https://david-dm.org/appium/appium-xcode/dev-status.svg)](https://david-dm.org/appium/appium-xcode#info=devDependencies)
[![Build Status](https://travis-ci.org/appium/appium-xcode.svg?branch=master)](https://travis-ci.org/appium/appium-xcode)
[![Coverage Status](https://coveralls.io/repos/appium/appium-xcode/badge.svg)](https://coveralls.io/r/appium/appium-xcode)
[![Greenkeeper badge](https://badges.greenkeeper.io/appium/appium-xcode.svg)](https://greenkeeper.io/)

@@ -10,0 +12,0 @@ ES7 module for interacting with Xcode and Xcode-related functions.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc