@ciscospark/bin-sauce-connect
Advanced tools
Comparing version 1.21.1 to 1.21.2
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -7,3 +7,3 @@ /*! | ||
var fs = require("fs"); | ||
var fs = require('fs'); | ||
@@ -10,0 +10,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -7,8 +7,8 @@ /*! | ||
var path = require("path"); | ||
var path = require('path'); | ||
var dotSauce = exports.dotSauce = path.join(__dirname, "..", "..", "..", "..", "..", "..", ".sauce" + (process.env.PACKAGE ? "/" + process.env.PACKAGE : "")); | ||
exports.logFile = path.join(dotSauce, "sauce_connect" + (process.env.SUITE_RUN_COUNT ? "." + process.env.SUITE_RUN_COUNT : "") + ".log"); | ||
exports.pidFile = path.join(dotSauce, "sc.pid"); | ||
exports.readyFile = path.join(dotSauce, "sc.ready"); | ||
var dotSauce = exports.dotSauce = path.join(__dirname, '..', '..', '..', '..', '..', '..', '.sauce' + (process.env.PACKAGE ? '/' + process.env.PACKAGE : '')); | ||
exports.logFile = path.join(dotSauce, 'sauce_connect' + (process.env.SUITE_RUN_COUNT ? '.' + process.env.SUITE_RUN_COUNT : '') + '.log'); | ||
exports.pidFile = path.join(dotSauce, 'sc.pid'); | ||
exports.readyFile = path.join(dotSauce, 'sc.ready'); | ||
//# sourceMappingURL=paths.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -7,5 +7,5 @@ /*! | ||
var fs = require("fs"); | ||
var fs = require('fs'); | ||
module.exports = fs.unlinkSync; | ||
//# sourceMappingURL=rm.js.map |
@@ -1,4 +0,4 @@ | ||
"use strict"; | ||
'use strict'; | ||
var _promise = require("babel-runtime/core-js/promise"); | ||
var _promise = require('babel-runtime/core-js/promise'); | ||
@@ -13,5 +13,5 @@ var _promise2 = _interopRequireDefault(_promise); | ||
var cp = require("child_process"); | ||
var cp = require('child_process'); | ||
var _require = require("lodash"), | ||
var _require = require('lodash'), | ||
defaults = _require.defaults; | ||
@@ -31,14 +31,14 @@ | ||
if (!cmd) { | ||
return reject(new Error("`cmd` is required")); | ||
return reject(new Error('`cmd` is required')); | ||
} | ||
console.info("Running `" + cmd + " " + args.join(" ") + "` in " + process.cwd()); | ||
console.info('Running `' + cmd + ' ' + args.join(' ') + '` in ' + process.cwd()); | ||
var child = cp.spawn(cmd, args, defaults(options), { | ||
// At some point, this'll need to be node-version dependent | ||
std: ["pipe", "pipe", "pipe"] | ||
std: ['pipe', 'pipe', 'pipe'] | ||
}); | ||
var data = ""; | ||
var data = ''; | ||
if (child.stderr) { | ||
child.stderr.on("data", function (d) { | ||
child.stderr.on('data', function (d) { | ||
data += d; | ||
@@ -50,3 +50,3 @@ process.stderr.write(d.toString()); | ||
if (child.stdout) { | ||
child.stdout.on("data", function (d) { | ||
child.stdout.on('data', function (d) { | ||
process.stdout.write(d.toString()); | ||
@@ -56,3 +56,3 @@ }); | ||
child.on("close", function (code) { | ||
child.on('close', function (code) { | ||
if (code) { | ||
@@ -59,0 +59,0 @@ var e = new Error(code); |
@@ -1,4 +0,4 @@ | ||
"use strict"; | ||
'use strict'; | ||
var _promise = require("babel-runtime/core-js/promise"); | ||
var _promise = require('babel-runtime/core-js/promise'); | ||
@@ -14,5 +14,5 @@ var _promise2 = _interopRequireDefault(_promise); | ||
// require(`babel-polyfill`); | ||
var mkdirp = require("mkdirp"); | ||
var mkdirp = require('mkdirp'); | ||
var _require = require("./lib/paths"), | ||
var _require = require('./lib/paths'), | ||
dotSauce = _require.dotSauce, | ||
@@ -23,17 +23,17 @@ logFile = _require.logFile, | ||
var exists = require("./lib/exists"); | ||
var spawn = require("./lib/spawn"); | ||
var rm = require("./lib/rm"); | ||
var exists = require('./lib/exists'); | ||
var spawn = require('./lib/spawn'); | ||
var rm = require('./lib/rm'); | ||
var SAUCE_CONNECT_VERSION = "4.4.2"; | ||
var SAUCE_CONNECT_VERSION = '4.4.2'; | ||
if (exists(pidFile)) { | ||
console.log("Sauce Connect already connected"); | ||
console.log('Sauce Connect already connected'); | ||
process.exit(0); | ||
} | ||
checkRequiredEnvironment(["SAUCE_USERNAME", "SAUCE_ACCESS_KEY", "SC_TUNNEL_IDENTIFIER"]); | ||
checkRequiredEnvironment(['SAUCE_USERNAME', 'SAUCE_ACCESS_KEY', 'SC_TUNNEL_IDENTIFIER']); | ||
_promise2.default.resolve().then(downloadSauceConnect).then(function () { | ||
return spawn("rm", ["-f", logFile]); | ||
return spawn('rm', ['-f', logFile]); | ||
}).then(connectWithRetry).catch(function (reason) { | ||
@@ -54,3 +54,3 @@ console.error(reason.stack); | ||
if (!process.env[key]) { | ||
throw new Error("`" + key + "` is required"); | ||
throw new Error('`' + key + '` is required'); | ||
} | ||
@@ -68,3 +68,3 @@ }); | ||
var options = { | ||
stdio: "ignore", | ||
stdio: 'ignore', | ||
detached: true | ||
@@ -80,3 +80,3 @@ }; | ||
if (!exists(readyFile)) { | ||
console.log("Failed to connect to Sauce Labs"); | ||
console.log('Failed to connect to Sauce Labs'); | ||
options.child.kill(); | ||
@@ -91,3 +91,3 @@ return reject(); | ||
if (exists(readyFile)) { | ||
console.log("Connected to Sauce Labs"); | ||
console.log('Connected to Sauce Labs'); | ||
clearTimeout(timer); | ||
@@ -99,3 +99,3 @@ clearInterval(interval); | ||
spawn("sc/bin/sc", ["-B", ["mercury-connection-intb.ciscospark.com", "idbroker.webex.com", "127.0.0.1", "localhost", "*.wbx2.com", "*.ciscospark.com"].join(","), "-t", ["whistler.onint.ciscospark.com", "internal-testing-services.wbx2.com", "calendar-whistler.onint.ciscospark.com", "127.0.0.1", "localhost"].join(","), "-vv", "-l", "" + logFile, "--pidfile", pidFile, "--readyfile", readyFile, "--tunnel-identifier", process.env.SC_TUNNEL_IDENTIFIER], options).catch(reject); | ||
spawn('sc/bin/sc', ['-B', ['mercury-connection-intb.ciscospark.com', 'idbroker.webex.com', '127.0.0.1', 'localhost', '*.wbx2.com', '*.ciscospark.com'].join(','), '-t', ['whistler.onint.ciscospark.com', 'internal-testing-services.wbx2.com', 'calendar-whistler.onint.ciscospark.com', '127.0.0.1', 'localhost'].join(','), '-vv', '-l', '' + logFile, '--pidfile', pidFile, '--readyfile', readyFile, '--tunnel-identifier', process.env.SC_TUNNEL_IDENTIFIER], options).catch(reject); | ||
}); | ||
@@ -116,3 +116,3 @@ } | ||
if (exists(pidFile)) { | ||
console.log("pid file not removed; forcibly removing"); | ||
console.log('pid file not removed; forcibly removing'); | ||
rm(pidFile); | ||
@@ -140,9 +140,9 @@ resolve(); | ||
return connect().catch(function () { | ||
console.warn("Timed out connecting to Sauce Labs, retrying"); | ||
console.warn('Timed out connecting to Sauce Labs, retrying'); | ||
return blockUntilClosed().then(connect); | ||
}).catch(function () { | ||
console.warn("Timed out connecting to Sauce Labs, retrying"); | ||
console.warn('Timed out connecting to Sauce Labs, retrying'); | ||
return blockUntilClosed().then(connect); | ||
}).catch(function () { | ||
console.error("Failed to connect to Sauce Labs after three attempts, aborting"); | ||
console.error('Failed to connect to Sauce Labs after three attempts, aborting'); | ||
process.exit(2); | ||
@@ -160,18 +160,18 @@ }); | ||
process.chdir(dotSauce); | ||
if (exists("sc")) { | ||
if (exists('sc')) { | ||
return _promise2.default.resolve(); | ||
} | ||
var scBasename = "sc-" + SAUCE_CONNECT_VERSION + "-" + (process.platform === "darwin" ? "osx" : "linux"); | ||
var scPackage = "" + scBasename + (process.platform === "darwin" ? ".zip" : ".tar.gz"); | ||
var scUrl = "https://saucelabs.com/downloads/" + scPackage; | ||
return spawn("curl", ["-o", scPackage, scUrl]).then(function () { | ||
if (process.platform === "darwin") { | ||
return spawn("unzip", [scPackage]); | ||
var scBasename = 'sc-' + SAUCE_CONNECT_VERSION + '-' + (process.platform === 'darwin' ? 'osx' : 'linux'); | ||
var scPackage = '' + scBasename + (process.platform === 'darwin' ? '.zip' : '.tar.gz'); | ||
var scUrl = 'https://saucelabs.com/downloads/' + scPackage; | ||
return spawn('curl', ['-o', scPackage, scUrl]).then(function () { | ||
if (process.platform === 'darwin') { | ||
return spawn('unzip', [scPackage]); | ||
} | ||
return spawn("tar", ["-xf", scPackage]); | ||
return spawn('tar', ['-xf', scPackage]); | ||
}).then(function () { | ||
return spawn("mv", [scBasename, "sc"]); | ||
return spawn('mv', [scBasename, 'sc']); | ||
}); | ||
} | ||
//# sourceMappingURL=start.js.map |
@@ -1,4 +0,4 @@ | ||
"use strict"; | ||
'use strict'; | ||
var _promise = require("babel-runtime/core-js/promise"); | ||
var _promise = require('babel-runtime/core-js/promise'); | ||
@@ -13,13 +13,13 @@ var _promise2 = _interopRequireDefault(_promise); | ||
var fs = require("fs"); | ||
var exists = require("./lib/exists"); | ||
var fs = require('fs'); | ||
var exists = require('./lib/exists'); | ||
var _require = require("./lib/paths"), | ||
var _require = require('./lib/paths'), | ||
pidFile = _require.pidFile; | ||
var spawn = require("./lib/spawn"); | ||
var spawn = require('./lib/spawn'); | ||
_promise2.default.resolve().then(function () { | ||
var pid = parseInt(fs.readFileSync(pidFile), 10); | ||
return spawn("kill", ["-TERM", pid]); | ||
return spawn('kill', ['-TERM', pid]); | ||
}).then(function () { | ||
@@ -31,3 +31,3 @@ return new _promise2.default(function (resolve, reject) { | ||
clearInterval(interval); | ||
reject("Failed to disconnect from Sauce Labs"); | ||
reject(new Error('Failed to disconnect from Sauce Labs')); | ||
}, 60000); | ||
@@ -34,0 +34,0 @@ |
{ | ||
"name": "@ciscospark/bin-sauce-connect", | ||
"version": "1.21.1", | ||
"version": "1.21.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -5,3 +5,3 @@ /*! | ||
const fs = require(`fs`); | ||
const fs = require('fs'); | ||
@@ -8,0 +8,0 @@ /** |
@@ -5,7 +5,7 @@ /*! | ||
const path = require(`path`); | ||
const path = require('path'); | ||
const dotSauce = exports.dotSauce = path.join(__dirname, `..`, `..`, `..`, `..`, `..`, `..`, `.sauce${process.env.PACKAGE ? `/${process.env.PACKAGE}` : ``}`); | ||
exports.logFile = path.join(dotSauce, `sauce_connect${process.env.SUITE_RUN_COUNT ? `.${process.env.SUITE_RUN_COUNT}` : ``}.log`); | ||
exports.pidFile = path.join(dotSauce, `sc.pid`); | ||
exports.readyFile = path.join(dotSauce, `sc.ready`); | ||
const dotSauce = exports.dotSauce = path.join(__dirname, '..', '..', '..', '..', '..', '..', `.sauce${process.env.PACKAGE ? `/${process.env.PACKAGE}` : ''}`); | ||
exports.logFile = path.join(dotSauce, `sauce_connect${process.env.SUITE_RUN_COUNT ? `.${process.env.SUITE_RUN_COUNT}` : ''}.log`); | ||
exports.pidFile = path.join(dotSauce, 'sc.pid'); | ||
exports.readyFile = path.join(dotSauce, 'sc.ready'); |
@@ -5,4 +5,4 @@ /*! | ||
const fs = require(`fs`); | ||
const fs = require('fs'); | ||
module.exports = fs.unlinkSync; |
@@ -5,4 +5,4 @@ /*! | ||
const cp = require(`child_process`); | ||
const {defaults} = require(`lodash`); | ||
const cp = require('child_process'); | ||
const {defaults} = require('lodash'); | ||
@@ -19,14 +19,14 @@ /** | ||
if (!cmd) { | ||
return reject(new Error(`\`cmd\` is required`)); | ||
return reject(new Error('`cmd` is required')); | ||
} | ||
console.info(`Running \`${cmd} ${args.join(` `)}\` in ${process.cwd()}`); | ||
console.info(`Running \`${cmd} ${args.join(' ')}\` in ${process.cwd()}`); | ||
const child = cp.spawn(cmd, args, defaults(options), { | ||
// At some point, this'll need to be node-version dependent | ||
std: [`pipe`, `pipe`, `pipe`] | ||
std: ['pipe', 'pipe', 'pipe'] | ||
}); | ||
let data = ``; | ||
let data = ''; | ||
if (child.stderr) { | ||
child.stderr.on(`data`, (d) => { | ||
child.stderr.on('data', (d) => { | ||
data += d; | ||
@@ -38,3 +38,3 @@ process.stderr.write(d.toString()); | ||
if (child.stdout) { | ||
child.stdout.on(`data`, (d) => { | ||
child.stdout.on('data', (d) => { | ||
process.stdout.write(d.toString()); | ||
@@ -44,3 +44,3 @@ }); | ||
child.on(`close`, (code) => { | ||
child.on('close', (code) => { | ||
if (code) { | ||
@@ -47,0 +47,0 @@ const e = new Error(code); |
@@ -6,12 +6,14 @@ /*! | ||
// require(`babel-polyfill`); | ||
const mkdirp = require(`mkdirp`); | ||
const {dotSauce, logFile, pidFile, readyFile} = require(`./lib/paths`); | ||
const exists = require(`./lib/exists`); | ||
const spawn = require(`./lib/spawn`); | ||
const rm = require(`./lib/rm`); | ||
const mkdirp = require('mkdirp'); | ||
const { | ||
dotSauce, logFile, pidFile, readyFile | ||
} = require('./lib/paths'); | ||
const exists = require('./lib/exists'); | ||
const spawn = require('./lib/spawn'); | ||
const rm = require('./lib/rm'); | ||
const SAUCE_CONNECT_VERSION = `4.4.2`; | ||
const SAUCE_CONNECT_VERSION = '4.4.2'; | ||
if (exists(pidFile)) { | ||
console.log(`Sauce Connect already connected`); | ||
console.log('Sauce Connect already connected'); | ||
process.exit(0); | ||
@@ -21,5 +23,5 @@ } | ||
checkRequiredEnvironment([ | ||
`SAUCE_USERNAME`, | ||
`SAUCE_ACCESS_KEY`, | ||
`SC_TUNNEL_IDENTIFIER` | ||
'SAUCE_USERNAME', | ||
'SAUCE_ACCESS_KEY', | ||
'SC_TUNNEL_IDENTIFIER' | ||
]); | ||
@@ -29,3 +31,3 @@ | ||
.then(downloadSauceConnect) | ||
.then(() => spawn(`rm`, [`-f`, logFile])) | ||
.then(() => spawn('rm', ['-f', logFile])) | ||
.then(connectWithRetry) | ||
@@ -60,3 +62,3 @@ .catch((reason) => { | ||
const options = { | ||
stdio: `ignore`, | ||
stdio: 'ignore', | ||
detached: true | ||
@@ -72,3 +74,3 @@ }; | ||
if (!exists(readyFile)) { | ||
console.log(`Failed to connect to Sauce Labs`); | ||
console.log('Failed to connect to Sauce Labs'); | ||
options.child.kill(); | ||
@@ -83,3 +85,3 @@ return reject(); | ||
if (exists(readyFile)) { | ||
console.log(`Connected to Sauce Labs`); | ||
console.log('Connected to Sauce Labs'); | ||
clearTimeout(timer); | ||
@@ -91,23 +93,23 @@ clearInterval(interval); | ||
spawn(`sc/bin/sc`, [ | ||
`-B`, [ | ||
`mercury-connection-intb.ciscospark.com`, | ||
`idbroker.webex.com`, | ||
`127.0.0.1`, | ||
`localhost`, | ||
`*.wbx2.com`, | ||
`*.ciscospark.com` | ||
].join(`,`), | ||
`-t`, [ | ||
`whistler.onint.ciscospark.com`, | ||
`internal-testing-services.wbx2.com`, | ||
`calendar-whistler.onint.ciscospark.com`, | ||
`127.0.0.1`, | ||
`localhost` | ||
].join(`,`), | ||
`-vv`, | ||
`-l`, `${logFile}`, | ||
`--pidfile`, pidFile, | ||
`--readyfile`, readyFile, | ||
`--tunnel-identifier`, process.env.SC_TUNNEL_IDENTIFIER | ||
spawn('sc/bin/sc', [ | ||
'-B', [ | ||
'mercury-connection-intb.ciscospark.com', | ||
'idbroker.webex.com', | ||
'127.0.0.1', | ||
'localhost', | ||
'*.wbx2.com', | ||
'*.ciscospark.com' | ||
].join(','), | ||
'-t', [ | ||
'whistler.onint.ciscospark.com', | ||
'internal-testing-services.wbx2.com', | ||
'calendar-whistler.onint.ciscospark.com', | ||
'127.0.0.1', | ||
'localhost' | ||
].join(','), | ||
'-vv', | ||
'-l', `${logFile}`, | ||
'--pidfile', pidFile, | ||
'--readyfile', readyFile, | ||
'--tunnel-identifier', process.env.SC_TUNNEL_IDENTIFIER | ||
], options) | ||
@@ -130,3 +132,3 @@ .catch(reject); | ||
if (exists(pidFile)) { | ||
console.log(`pid file not removed; forcibly removing`); | ||
console.log('pid file not removed; forcibly removing'); | ||
rm(pidFile); | ||
@@ -155,11 +157,11 @@ resolve(); | ||
.catch(() => { | ||
console.warn(`Timed out connecting to Sauce Labs, retrying`); | ||
console.warn('Timed out connecting to Sauce Labs, retrying'); | ||
return blockUntilClosed().then(connect); | ||
}) | ||
.catch(() => { | ||
console.warn(`Timed out connecting to Sauce Labs, retrying`); | ||
console.warn('Timed out connecting to Sauce Labs, retrying'); | ||
return blockUntilClosed().then(connect); | ||
}) | ||
.catch(() => { | ||
console.error(`Failed to connect to Sauce Labs after three attempts, aborting`); | ||
console.error('Failed to connect to Sauce Labs after three attempts, aborting'); | ||
process.exit(2); | ||
@@ -177,18 +179,17 @@ }); | ||
process.chdir(dotSauce); | ||
if (exists(`sc`)) { | ||
if (exists('sc')) { | ||
return Promise.resolve(); | ||
} | ||
const scBasename = `sc-${SAUCE_CONNECT_VERSION}-${process.platform === `darwin` ? `osx` : `linux`}`; | ||
const scPackage = `${scBasename}${process.platform === `darwin` ? `.zip` : `.tar.gz`}`; | ||
const scBasename = `sc-${SAUCE_CONNECT_VERSION}-${process.platform === 'darwin' ? 'osx' : 'linux'}`; | ||
const scPackage = `${scBasename}${process.platform === 'darwin' ? '.zip' : '.tar.gz'}`; | ||
const scUrl = `https://saucelabs.com/downloads/${scPackage}`; | ||
return spawn(`curl`, [`-o`, scPackage, scUrl]) | ||
return spawn('curl', ['-o', scPackage, scUrl]) | ||
.then(() => { | ||
if (process.platform === `darwin`) { | ||
return spawn(`unzip`, [scPackage]); | ||
if (process.platform === 'darwin') { | ||
return spawn('unzip', [scPackage]); | ||
} | ||
return spawn(`tar`, [`-xf`, scPackage]); | ||
return spawn('tar', ['-xf', scPackage]); | ||
}) | ||
.then(() => spawn(`mv`, [scBasename, `sc`])); | ||
.then(() => spawn('mv', [scBasename, 'sc'])); | ||
} |
@@ -5,6 +5,6 @@ /*! | ||
const fs = require(`fs`); | ||
const exists = require(`./lib/exists`); | ||
const {pidFile} = require(`./lib/paths`); | ||
const spawn = require(`./lib/spawn`); | ||
const fs = require('fs'); | ||
const exists = require('./lib/exists'); | ||
const {pidFile} = require('./lib/paths'); | ||
const spawn = require('./lib/spawn'); | ||
@@ -14,3 +14,3 @@ Promise.resolve() | ||
const pid = parseInt(fs.readFileSync(pidFile), 10); | ||
return spawn(`kill`, [`-TERM`, pid]); | ||
return spawn('kill', ['-TERM', pid]); | ||
}) | ||
@@ -22,3 +22,3 @@ .then(() => new Promise((resolve, reject) => { | ||
clearInterval(interval); | ||
reject(`Failed to disconnect from Sauce Labs`); | ||
reject(new Error('Failed to disconnect from Sauce Labs')); | ||
}, 60000); | ||
@@ -25,0 +25,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
34031
557
19
21
2