Fix action.test.ts to accept windows as a base platform
parent
c63ab9855a
commit
18a1268d20
|
|
@ -358,9 +358,9 @@ class Docker {
|
||||||
const { path, dockerfile, baseImage } = buildParameters;
|
const { path, dockerfile, baseImage } = buildParameters;
|
||||||
const { version, platform } = baseImage;
|
const { version, platform } = baseImage;
|
||||||
const tag = new image_tag_1.default({ repository: '', name: 'unity-builder', version, platform });
|
const tag = new image_tag_1.default({ repository: '', name: 'unity-builder', version, platform });
|
||||||
const command = `docker build ${path} \
|
const command = `docker build ${path} \
|
||||||
--file ${dockerfile} \
|
--file ${dockerfile} \
|
||||||
--build-arg IMAGE=${baseImage} \
|
--build-arg IMAGE=${baseImage} \
|
||||||
--tag ${tag}`;
|
--tag ${tag}`;
|
||||||
yield exec_1.exec(command, undefined, { silent });
|
yield exec_1.exec(command, undefined, { silent });
|
||||||
return tag;
|
return tag;
|
||||||
|
|
@ -371,56 +371,56 @@ class Docker {
|
||||||
const { version, workspace, runnerTempPath, platform, projectPath, buildName, buildPath, buildFile, buildMethod, buildVersion, androidVersionCode, androidKeystoreName, androidKeystoreBase64, androidKeystorePass, androidKeyaliasName, androidKeyaliasPass, androidTargetSdkVersion, androidSdkManagerParameters, customParameters, sshAgent, gitPrivateToken, chownFilesTo, } = parameters;
|
const { version, workspace, runnerTempPath, platform, projectPath, buildName, buildPath, buildFile, buildMethod, buildVersion, androidVersionCode, androidKeystoreName, androidKeystoreBase64, androidKeystorePass, androidKeyaliasName, androidKeyaliasPass, androidTargetSdkVersion, androidSdkManagerParameters, customParameters, sshAgent, gitPrivateToken, chownFilesTo, } = parameters;
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case 'linux': {
|
case 'linux': {
|
||||||
const linuxRunCommand = `docker run \
|
const linuxRunCommand = `docker run \
|
||||||
--workdir /github/workspace \
|
--workdir /github/workspace \
|
||||||
--rm \
|
--rm \
|
||||||
--env UNITY_LICENSE \
|
--env UNITY_LICENSE \
|
||||||
--env UNITY_LICENSE_FILE \
|
--env UNITY_LICENSE_FILE \
|
||||||
--env UNITY_EMAIL \
|
--env UNITY_EMAIL \
|
||||||
--env UNITY_PASSWORD \
|
--env UNITY_PASSWORD \
|
||||||
--env UNITY_SERIAL \
|
--env UNITY_SERIAL \
|
||||||
--env UNITY_VERSION="${version}" \
|
--env UNITY_VERSION="${version}" \
|
||||||
--env USYM_UPLOAD_AUTH_TOKEN \
|
--env USYM_UPLOAD_AUTH_TOKEN \
|
||||||
--env PROJECT_PATH="${projectPath}" \
|
--env PROJECT_PATH="${projectPath}" \
|
||||||
--env BUILD_TARGET="${platform}" \
|
--env BUILD_TARGET="${platform}" \
|
||||||
--env BUILD_NAME="${buildName}" \
|
--env BUILD_NAME="${buildName}" \
|
||||||
--env BUILD_PATH="${buildPath}" \
|
--env BUILD_PATH="${buildPath}" \
|
||||||
--env BUILD_FILE="${buildFile}" \
|
--env BUILD_FILE="${buildFile}" \
|
||||||
--env BUILD_METHOD="${buildMethod}" \
|
--env BUILD_METHOD="${buildMethod}" \
|
||||||
--env VERSION="${buildVersion}" \
|
--env VERSION="${buildVersion}" \
|
||||||
--env ANDROID_VERSION_CODE="${androidVersionCode}" \
|
--env ANDROID_VERSION_CODE="${androidVersionCode}" \
|
||||||
--env ANDROID_KEYSTORE_NAME="${androidKeystoreName}" \
|
--env ANDROID_KEYSTORE_NAME="${androidKeystoreName}" \
|
||||||
--env ANDROID_KEYSTORE_BASE64="${androidKeystoreBase64}" \
|
--env ANDROID_KEYSTORE_BASE64="${androidKeystoreBase64}" \
|
||||||
--env ANDROID_KEYSTORE_PASS="${androidKeystorePass}" \
|
--env ANDROID_KEYSTORE_PASS="${androidKeystorePass}" \
|
||||||
--env ANDROID_KEYALIAS_NAME="${androidKeyaliasName}" \
|
--env ANDROID_KEYALIAS_NAME="${androidKeyaliasName}" \
|
||||||
--env ANDROID_KEYALIAS_PASS="${androidKeyaliasPass}" \
|
--env ANDROID_KEYALIAS_PASS="${androidKeyaliasPass}" \
|
||||||
--env ANDROID_TARGET_SDK_VERSION="${androidTargetSdkVersion}" \
|
--env ANDROID_TARGET_SDK_VERSION="${androidTargetSdkVersion}" \
|
||||||
--env ANDROID_SDK_MANAGER_PARAMETERS="${androidSdkManagerParameters}" \
|
--env ANDROID_SDK_MANAGER_PARAMETERS="${androidSdkManagerParameters}" \
|
||||||
--env CUSTOM_PARAMETERS="${customParameters}" \
|
--env CUSTOM_PARAMETERS="${customParameters}" \
|
||||||
--env CHOWN_FILES_TO="${chownFilesTo}" \
|
--env CHOWN_FILES_TO="${chownFilesTo}" \
|
||||||
--env GITHUB_REF \
|
--env GITHUB_REF \
|
||||||
--env GITHUB_SHA \
|
--env GITHUB_SHA \
|
||||||
--env GITHUB_REPOSITORY \
|
--env GITHUB_REPOSITORY \
|
||||||
--env GITHUB_ACTOR \
|
--env GITHUB_ACTOR \
|
||||||
--env GITHUB_WORKFLOW \
|
--env GITHUB_WORKFLOW \
|
||||||
--env GITHUB_HEAD_REF \
|
--env GITHUB_HEAD_REF \
|
||||||
--env GITHUB_BASE_REF \
|
--env GITHUB_BASE_REF \
|
||||||
--env GITHUB_EVENT_NAME \
|
--env GITHUB_EVENT_NAME \
|
||||||
--env GITHUB_WORKSPACE=/github/workspace \
|
--env GITHUB_WORKSPACE=/github/workspace \
|
||||||
--env GITHUB_ACTION \
|
--env GITHUB_ACTION \
|
||||||
--env GITHUB_EVENT_PATH \
|
--env GITHUB_EVENT_PATH \
|
||||||
--env RUNNER_OS \
|
--env RUNNER_OS \
|
||||||
--env RUNNER_TOOL_CACHE \
|
--env RUNNER_TOOL_CACHE \
|
||||||
--env RUNNER_TEMP \
|
--env RUNNER_TEMP \
|
||||||
--env RUNNER_WORKSPACE \
|
--env RUNNER_WORKSPACE \
|
||||||
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||||
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \
|
||||||
--volume "/var/run/docker.sock":"/var/run/docker.sock" \
|
--volume "/var/run/docker.sock":"/var/run/docker.sock" \
|
||||||
--volume "${runnerTempPath}/_github_home":"/root" \
|
--volume "${runnerTempPath}/_github_home":"/root" \
|
||||||
--volume "${runnerTempPath}/_github_workflow":"/github/workflow" \
|
--volume "${runnerTempPath}/_github_workflow":"/github/workflow" \
|
||||||
--volume "${workspace}":"/github/workspace" \
|
--volume "${workspace}":"/github/workspace" \
|
||||||
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
|
${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \
|
||||||
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \
|
${sshAgent ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro' : ''} \
|
||||||
${image}`;
|
${image}`;
|
||||||
yield exec_1.exec(linuxRunCommand, undefined, { silent });
|
yield exec_1.exec(linuxRunCommand, undefined, { silent });
|
||||||
break;
|
break;
|
||||||
|
|
@ -430,9 +430,9 @@ class Docker {
|
||||||
if (!process.env.UNITY_SERIAL) {
|
if (!process.env.UNITY_SERIAL) {
|
||||||
//No serial was present so it is a personal license that we need to convert
|
//No serial was present so it is a personal license that we need to convert
|
||||||
if (!process.env.UNITY_LICENSE) {
|
if (!process.env.UNITY_LICENSE) {
|
||||||
throw new Error(`Missing Unity License File and no Serial was found. If this
|
throw new Error(`Missing Unity License File and no Serial was found. If this
|
||||||
is a personal license, make sure to follow the activation
|
is a personal license, make sure to follow the activation
|
||||||
steps and set the UNITY_LICENSE GitHub secret or enter a Unity
|
steps and set the UNITY_LICENSE GitHub secret or enter a Unity
|
||||||
serial number inside the UNITY_SERIAL GitHub secret.`);
|
serial number inside the UNITY_SERIAL GitHub secret.`);
|
||||||
}
|
}
|
||||||
unitySerial = this.getSerialFromLicenseFile(process.env.UNITY_LICENSE);
|
unitySerial = this.getSerialFromLicenseFile(process.env.UNITY_LICENSE);
|
||||||
|
|
@ -445,56 +445,56 @@ class Docker {
|
||||||
}
|
}
|
||||||
yield this.setupWindowsRun(platform);
|
yield this.setupWindowsRun(platform);
|
||||||
this.validateWindowsPlatformRequirements(platform);
|
this.validateWindowsPlatformRequirements(platform);
|
||||||
const windowsRunCommand = `docker run \
|
const windowsRunCommand = `docker run \
|
||||||
--workdir c:/github/workspace \
|
--workdir c:/github/workspace \
|
||||||
--rm \
|
--rm \
|
||||||
--env UNITY_LICENSE \
|
--env UNITY_LICENSE \
|
||||||
--env UNITY_LICENSE_FILE \
|
--env UNITY_LICENSE_FILE \
|
||||||
--env UNITY_EMAIL \
|
--env UNITY_EMAIL \
|
||||||
--env UNITY_PASSWORD \
|
--env UNITY_PASSWORD \
|
||||||
--env UNITY_SERIAL="${unitySerial}" \
|
--env UNITY_SERIAL="${unitySerial}" \
|
||||||
--env UNITY_VERSION="${version}" \
|
--env UNITY_VERSION="${version}" \
|
||||||
--env USYM_UPLOAD_AUTH_TOKEN \
|
--env USYM_UPLOAD_AUTH_TOKEN \
|
||||||
--env PROJECT_PATH="${projectPath}" \
|
--env PROJECT_PATH="${projectPath}" \
|
||||||
--env BUILD_TARGET="${platform}" \
|
--env BUILD_TARGET="${platform}" \
|
||||||
--env BUILD_NAME="${buildName}" \
|
--env BUILD_NAME="${buildName}" \
|
||||||
--env BUILD_PATH="${buildPath}" \
|
--env BUILD_PATH="${buildPath}" \
|
||||||
--env BUILD_FILE="${buildFile}" \
|
--env BUILD_FILE="${buildFile}" \
|
||||||
--env BUILD_METHOD="${buildMethod}" \
|
--env BUILD_METHOD="${buildMethod}" \
|
||||||
--env VERSION="${buildVersion}" \
|
--env VERSION="${buildVersion}" \
|
||||||
--env ANDROID_VERSION_CODE="${androidVersionCode}" \
|
--env ANDROID_VERSION_CODE="${androidVersionCode}" \
|
||||||
--env ANDROID_KEYSTORE_NAME="${androidKeystoreName}" \
|
--env ANDROID_KEYSTORE_NAME="${androidKeystoreName}" \
|
||||||
--env ANDROID_KEYSTORE_BASE64="${androidKeystoreBase64}" \
|
--env ANDROID_KEYSTORE_BASE64="${androidKeystoreBase64}" \
|
||||||
--env ANDROID_KEYSTORE_PASS="${androidKeystorePass}" \
|
--env ANDROID_KEYSTORE_PASS="${androidKeystorePass}" \
|
||||||
--env ANDROID_KEYALIAS_NAME="${androidKeyaliasName}" \
|
--env ANDROID_KEYALIAS_NAME="${androidKeyaliasName}" \
|
||||||
--env ANDROID_KEYALIAS_PASS="${androidKeyaliasPass}" \
|
--env ANDROID_KEYALIAS_PASS="${androidKeyaliasPass}" \
|
||||||
--env ANDROID_TARGET_SDK_VERSION="${androidTargetSdkVersion}" \
|
--env ANDROID_TARGET_SDK_VERSION="${androidTargetSdkVersion}" \
|
||||||
--env ANDROID_SDK_MANAGER_PARAMETERS="${androidSdkManagerParameters}" \
|
--env ANDROID_SDK_MANAGER_PARAMETERS="${androidSdkManagerParameters}" \
|
||||||
--env CUSTOM_PARAMETERS="${customParameters}" \
|
--env CUSTOM_PARAMETERS="${customParameters}" \
|
||||||
--env CHOWN_FILES_TO="${chownFilesTo}" \
|
--env CHOWN_FILES_TO="${chownFilesTo}" \
|
||||||
--env GITHUB_REF \
|
--env GITHUB_REF \
|
||||||
--env GITHUB_SHA \
|
--env GITHUB_SHA \
|
||||||
--env GITHUB_REPOSITORY \
|
--env GITHUB_REPOSITORY \
|
||||||
--env GITHUB_ACTOR \
|
--env GITHUB_ACTOR \
|
||||||
--env GITHUB_WORKFLOW \
|
--env GITHUB_WORKFLOW \
|
||||||
--env GITHUB_HEAD_REF \
|
--env GITHUB_HEAD_REF \
|
||||||
--env GITHUB_BASE_REF \
|
--env GITHUB_BASE_REF \
|
||||||
--env GITHUB_EVENT_NAME \
|
--env GITHUB_EVENT_NAME \
|
||||||
--env GITHUB_WORKSPACE=/github/workspace \
|
--env GITHUB_WORKSPACE=/github/workspace \
|
||||||
--env GITHUB_ACTION \
|
--env GITHUB_ACTION \
|
||||||
--env GITHUB_EVENT_PATH \
|
--env GITHUB_EVENT_PATH \
|
||||||
--env RUNNER_OS \
|
--env RUNNER_OS \
|
||||||
--env RUNNER_TOOL_CACHE \
|
--env RUNNER_TOOL_CACHE \
|
||||||
--env RUNNER_TEMP \
|
--env RUNNER_TEMP \
|
||||||
--env RUNNER_WORKSPACE \
|
--env RUNNER_WORKSPACE \
|
||||||
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
--env GIT_PRIVATE_TOKEN="${gitPrivateToken}" \
|
||||||
--volume "${runnerTempPath}/_github_home":"c:/root" \
|
--volume "${runnerTempPath}/_github_home":"c:/root" \
|
||||||
--volume "${runnerTempPath}/_github_workflow":"c:/github/workflow" \
|
--volume "${runnerTempPath}/_github_workflow":"c:/github/workflow" \
|
||||||
--volume "${workspace}":"c:/github/workspace" \
|
--volume "${workspace}":"c:/github/workspace" \
|
||||||
--volume "c:/regkeys":"c:/regkeys" \
|
--volume "c:/regkeys":"c:/regkeys" \
|
||||||
--volume "C:/Program Files (x86)/Microsoft Visual Studio":"C:/Program Files (x86)/Microsoft Visual Studio" \
|
--volume "C:/Program Files (x86)/Microsoft Visual Studio":"C:/Program Files (x86)/Microsoft Visual Studio" \
|
||||||
--volume "C:/Program Files (x86)/Windows Kits":"C:/Program Files (x86)/Windows Kits" \
|
--volume "C:/Program Files (x86)/Windows Kits":"C:/Program Files (x86)/Windows Kits" \
|
||||||
--volume "C:/ProgramData/Microsoft/VisualStudio":"C:/ProgramData/Microsoft/VisualStudio" \
|
--volume "C:/ProgramData/Microsoft/VisualStudio":"C:/ProgramData/Microsoft/VisualStudio" \
|
||||||
${image}`;
|
${image}`;
|
||||||
//Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
|
//Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
|
||||||
yield exec_1.exec(windowsRunCommand, undefined, { silent });
|
yield exec_1.exec(windowsRunCommand, undefined, { silent });
|
||||||
|
|
@ -553,8 +553,8 @@ class Docker {
|
||||||
static checkForWin10SDK() {
|
static checkForWin10SDK() {
|
||||||
//Check for Windows 10 SDK on runner
|
//Check for Windows 10 SDK on runner
|
||||||
if (!fs.existsSync('C:/Program Files (x86)/Windows Kits')) {
|
if (!fs.existsSync('C:/Program Files (x86)/Windows Kits')) {
|
||||||
throw new Error(`Windows 10 SDK not found in default location. Make sure
|
throw new Error(`Windows 10 SDK not found in default location. Make sure
|
||||||
the runner has a Windows 10 SDK installed in the default
|
the runner has a Windows 10 SDK installed in the default
|
||||||
location.`);
|
location.`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -562,8 +562,8 @@ class Docker {
|
||||||
//Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
|
//Note: When upgrading to Server 2022, we will need to move to just "program files" since VS will be 64-bit
|
||||||
if (!(fs.existsSync('C:/Program Files (x86)/Microsoft Visual Studio') &&
|
if (!(fs.existsSync('C:/Program Files (x86)/Microsoft Visual Studio') &&
|
||||||
fs.existsSync('C:/ProgramData/Microsoft/VisualStudio'))) {
|
fs.existsSync('C:/ProgramData/Microsoft/VisualStudio'))) {
|
||||||
throw new Error(`Visual Studio not found at the default location.
|
throw new Error(`Visual Studio not found at the default location.
|
||||||
Make sure the runner has Visual Studio installed in the
|
Make sure the runner has Visual Studio installed in the
|
||||||
default location`);
|
default location`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -129307,8 +129307,6 @@ module.exports.MaxBufferError = MaxBufferError;
|
||||||
/***/ 47625:
|
/***/ 47625:
|
||||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||||
|
|
||||||
exports.alphasort = alphasort
|
|
||||||
exports.alphasorti = alphasorti
|
|
||||||
exports.setopts = setopts
|
exports.setopts = setopts
|
||||||
exports.ownProp = ownProp
|
exports.ownProp = ownProp
|
||||||
exports.makeAbs = makeAbs
|
exports.makeAbs = makeAbs
|
||||||
|
|
@ -129321,17 +129319,14 @@ function ownProp (obj, field) {
|
||||||
return Object.prototype.hasOwnProperty.call(obj, field)
|
return Object.prototype.hasOwnProperty.call(obj, field)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var fs = __webpack_require__(35747)
|
||||||
var path = __webpack_require__(85622)
|
var path = __webpack_require__(85622)
|
||||||
var minimatch = __webpack_require__(83973)
|
var minimatch = __webpack_require__(83973)
|
||||||
var isAbsolute = __webpack_require__(38714)
|
var isAbsolute = __webpack_require__(38714)
|
||||||
var Minimatch = minimatch.Minimatch
|
var Minimatch = minimatch.Minimatch
|
||||||
|
|
||||||
function alphasorti (a, b) {
|
|
||||||
return a.toLowerCase().localeCompare(b.toLowerCase())
|
|
||||||
}
|
|
||||||
|
|
||||||
function alphasort (a, b) {
|
function alphasort (a, b) {
|
||||||
return a.localeCompare(b)
|
return a.localeCompare(b, 'en')
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupIgnores (self, options) {
|
function setupIgnores (self, options) {
|
||||||
|
|
@ -129390,6 +129385,7 @@ function setopts (self, pattern, options) {
|
||||||
self.stat = !!options.stat
|
self.stat = !!options.stat
|
||||||
self.noprocess = !!options.noprocess
|
self.noprocess = !!options.noprocess
|
||||||
self.absolute = !!options.absolute
|
self.absolute = !!options.absolute
|
||||||
|
self.fs = options.fs || fs
|
||||||
|
|
||||||
self.maxLength = options.maxLength || Infinity
|
self.maxLength = options.maxLength || Infinity
|
||||||
self.cache = options.cache || Object.create(null)
|
self.cache = options.cache || Object.create(null)
|
||||||
|
|
@ -129459,7 +129455,7 @@ function finish (self) {
|
||||||
all = Object.keys(all)
|
all = Object.keys(all)
|
||||||
|
|
||||||
if (!self.nosort)
|
if (!self.nosort)
|
||||||
all = all.sort(self.nocase ? alphasorti : alphasort)
|
all = all.sort(alphasort)
|
||||||
|
|
||||||
// at *some* point we statted all of these
|
// at *some* point we statted all of these
|
||||||
if (self.mark) {
|
if (self.mark) {
|
||||||
|
|
@ -129596,7 +129592,6 @@ function childrenIgnored (self, path) {
|
||||||
|
|
||||||
module.exports = glob
|
module.exports = glob
|
||||||
|
|
||||||
var fs = __webpack_require__(35747)
|
|
||||||
var rp = __webpack_require__(46863)
|
var rp = __webpack_require__(46863)
|
||||||
var minimatch = __webpack_require__(83973)
|
var minimatch = __webpack_require__(83973)
|
||||||
var Minimatch = minimatch.Minimatch
|
var Minimatch = minimatch.Minimatch
|
||||||
|
|
@ -129607,8 +129602,6 @@ var assert = __webpack_require__(42357)
|
||||||
var isAbsolute = __webpack_require__(38714)
|
var isAbsolute = __webpack_require__(38714)
|
||||||
var globSync = __webpack_require__(29010)
|
var globSync = __webpack_require__(29010)
|
||||||
var common = __webpack_require__(47625)
|
var common = __webpack_require__(47625)
|
||||||
var alphasort = common.alphasort
|
|
||||||
var alphasorti = common.alphasorti
|
|
||||||
var setopts = common.setopts
|
var setopts = common.setopts
|
||||||
var ownProp = common.ownProp
|
var ownProp = common.ownProp
|
||||||
var inflight = __webpack_require__(52492)
|
var inflight = __webpack_require__(52492)
|
||||||
|
|
@ -130059,7 +130052,7 @@ Glob.prototype._readdirInGlobStar = function (abs, cb) {
|
||||||
var lstatcb = inflight(lstatkey, lstatcb_)
|
var lstatcb = inflight(lstatkey, lstatcb_)
|
||||||
|
|
||||||
if (lstatcb)
|
if (lstatcb)
|
||||||
fs.lstat(abs, lstatcb)
|
self.fs.lstat(abs, lstatcb)
|
||||||
|
|
||||||
function lstatcb_ (er, lstat) {
|
function lstatcb_ (er, lstat) {
|
||||||
if (er && er.code === 'ENOENT')
|
if (er && er.code === 'ENOENT')
|
||||||
|
|
@ -130100,7 +130093,7 @@ Glob.prototype._readdir = function (abs, inGlobStar, cb) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var self = this
|
var self = this
|
||||||
fs.readdir(abs, readdirCb(this, abs, cb))
|
self.fs.readdir(abs, readdirCb(this, abs, cb))
|
||||||
}
|
}
|
||||||
|
|
||||||
function readdirCb (self, abs, cb) {
|
function readdirCb (self, abs, cb) {
|
||||||
|
|
@ -130304,13 +130297,13 @@ Glob.prototype._stat = function (f, cb) {
|
||||||
var self = this
|
var self = this
|
||||||
var statcb = inflight('stat\0' + abs, lstatcb_)
|
var statcb = inflight('stat\0' + abs, lstatcb_)
|
||||||
if (statcb)
|
if (statcb)
|
||||||
fs.lstat(abs, statcb)
|
self.fs.lstat(abs, statcb)
|
||||||
|
|
||||||
function lstatcb_ (er, lstat) {
|
function lstatcb_ (er, lstat) {
|
||||||
if (lstat && lstat.isSymbolicLink()) {
|
if (lstat && lstat.isSymbolicLink()) {
|
||||||
// If it's a symlink, then treat it as the target, unless
|
// If it's a symlink, then treat it as the target, unless
|
||||||
// the target does not exist, then treat it as a file.
|
// the target does not exist, then treat it as a file.
|
||||||
return fs.stat(abs, function (er, stat) {
|
return self.fs.stat(abs, function (er, stat) {
|
||||||
if (er)
|
if (er)
|
||||||
self._stat2(f, abs, null, lstat, cb)
|
self._stat2(f, abs, null, lstat, cb)
|
||||||
else
|
else
|
||||||
|
|
@ -130354,7 +130347,6 @@ Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
|
||||||
module.exports = globSync
|
module.exports = globSync
|
||||||
globSync.GlobSync = GlobSync
|
globSync.GlobSync = GlobSync
|
||||||
|
|
||||||
var fs = __webpack_require__(35747)
|
|
||||||
var rp = __webpack_require__(46863)
|
var rp = __webpack_require__(46863)
|
||||||
var minimatch = __webpack_require__(83973)
|
var minimatch = __webpack_require__(83973)
|
||||||
var Minimatch = minimatch.Minimatch
|
var Minimatch = minimatch.Minimatch
|
||||||
|
|
@ -130364,8 +130356,6 @@ var path = __webpack_require__(85622)
|
||||||
var assert = __webpack_require__(42357)
|
var assert = __webpack_require__(42357)
|
||||||
var isAbsolute = __webpack_require__(38714)
|
var isAbsolute = __webpack_require__(38714)
|
||||||
var common = __webpack_require__(47625)
|
var common = __webpack_require__(47625)
|
||||||
var alphasort = common.alphasort
|
|
||||||
var alphasorti = common.alphasorti
|
|
||||||
var setopts = common.setopts
|
var setopts = common.setopts
|
||||||
var ownProp = common.ownProp
|
var ownProp = common.ownProp
|
||||||
var childrenIgnored = common.childrenIgnored
|
var childrenIgnored = common.childrenIgnored
|
||||||
|
|
@ -130601,7 +130591,7 @@ GlobSync.prototype._readdirInGlobStar = function (abs) {
|
||||||
var lstat
|
var lstat
|
||||||
var stat
|
var stat
|
||||||
try {
|
try {
|
||||||
lstat = fs.lstatSync(abs)
|
lstat = this.fs.lstatSync(abs)
|
||||||
} catch (er) {
|
} catch (er) {
|
||||||
if (er.code === 'ENOENT') {
|
if (er.code === 'ENOENT') {
|
||||||
// lstat failed, doesn't exist
|
// lstat failed, doesn't exist
|
||||||
|
|
@ -130638,7 +130628,7 @@ GlobSync.prototype._readdir = function (abs, inGlobStar) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return this._readdirEntries(abs, fs.readdirSync(abs))
|
return this._readdirEntries(abs, this.fs.readdirSync(abs))
|
||||||
} catch (er) {
|
} catch (er) {
|
||||||
this._readdirError(abs, er)
|
this._readdirError(abs, er)
|
||||||
return null
|
return null
|
||||||
|
|
@ -130797,7 +130787,7 @@ GlobSync.prototype._stat = function (f) {
|
||||||
if (!stat) {
|
if (!stat) {
|
||||||
var lstat
|
var lstat
|
||||||
try {
|
try {
|
||||||
lstat = fs.lstatSync(abs)
|
lstat = this.fs.lstatSync(abs)
|
||||||
} catch (er) {
|
} catch (er) {
|
||||||
if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
|
if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
|
||||||
this.statCache[abs] = false
|
this.statCache[abs] = false
|
||||||
|
|
@ -130807,7 +130797,7 @@ GlobSync.prototype._stat = function (f) {
|
||||||
|
|
||||||
if (lstat && lstat.isSymbolicLink()) {
|
if (lstat && lstat.isSymbolicLink()) {
|
||||||
try {
|
try {
|
||||||
stat = fs.statSync(abs)
|
stat = this.fs.statSync(abs)
|
||||||
} catch (er) {
|
} catch (er) {
|
||||||
stat = lstat
|
stat = lstat
|
||||||
}
|
}
|
||||||
|
|
@ -171654,7 +171644,24 @@ function execSync(cmd, opts, pipe) {
|
||||||
stderrFile: stderrFile,
|
stderrFile: stderrFile,
|
||||||
};
|
};
|
||||||
|
|
||||||
fs.writeFileSync(paramsFile, JSON.stringify(paramsToSerialize), 'utf8');
|
// Create the files and ensure these are locked down (for read and write) to
|
||||||
|
// the current user. The main concerns here are:
|
||||||
|
//
|
||||||
|
// * If we execute a command which prints sensitive output, then
|
||||||
|
// stdoutFile/stderrFile must not be readable by other users.
|
||||||
|
// * paramsFile must not be readable by other users, or else they can read it
|
||||||
|
// to figure out the path for stdoutFile/stderrFile and create these first
|
||||||
|
// (locked down to their own access), which will crash exec() when it tries
|
||||||
|
// to write to the files.
|
||||||
|
function writeFileLockedDown(filePath, data) {
|
||||||
|
fs.writeFileSync(filePath, data, {
|
||||||
|
encoding: 'utf8',
|
||||||
|
mode: parseInt('600', 8),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
writeFileLockedDown(stdoutFile, '');
|
||||||
|
writeFileLockedDown(stderrFile, '');
|
||||||
|
writeFileLockedDown(paramsFile, JSON.stringify(paramsToSerialize));
|
||||||
|
|
||||||
var execArgs = [
|
var execArgs = [
|
||||||
__webpack_require__.ab + "exec-child.js",
|
__webpack_require__.ab + "exec-child.js",
|
||||||
|
|
@ -171697,6 +171704,7 @@ function execSync(cmd, opts, pipe) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// No biggie if we can't erase the files now -- they're in a temp dir anyway
|
// No biggie if we can't erase the files now -- they're in a temp dir anyway
|
||||||
|
// and we locked down permissions (see the note above).
|
||||||
try { common.unlinkSync(paramsFile); } catch (e) {}
|
try { common.unlinkSync(paramsFile); } catch (e) {}
|
||||||
try { common.unlinkSync(stderrFile); } catch (e) {}
|
try { common.unlinkSync(stderrFile); } catch (e) {}
|
||||||
try { common.unlinkSync(stdoutFile); } catch (e) {}
|
try { common.unlinkSync(stdoutFile); } catch (e) {}
|
||||||
|
|
@ -197280,7 +197288,7 @@ let fillPool = bytes => {
|
||||||
poolOffset += bytes
|
poolOffset += bytes
|
||||||
}
|
}
|
||||||
let random = bytes => {
|
let random = bytes => {
|
||||||
fillPool(bytes)
|
fillPool((bytes -= 0))
|
||||||
return pool.subarray(poolOffset - bytes, poolOffset)
|
return pool.subarray(poolOffset - bytes, poolOffset)
|
||||||
}
|
}
|
||||||
let customRandom = (alphabet, size, getRandom) => {
|
let customRandom = (alphabet, size, getRandom) => {
|
||||||
|
|
@ -197300,7 +197308,7 @@ let customRandom = (alphabet, size, getRandom) => {
|
||||||
}
|
}
|
||||||
let customAlphabet = (alphabet, size) => customRandom(alphabet, size, random)
|
let customAlphabet = (alphabet, size) => customRandom(alphabet, size, random)
|
||||||
let nanoid = (size = 21) => {
|
let nanoid = (size = 21) => {
|
||||||
fillPool(size)
|
fillPool((size -= 0))
|
||||||
let id = ''
|
let id = ''
|
||||||
for (let i = poolOffset - size; i < poolOffset; i++) {
|
for (let i = poolOffset - size; i < poolOffset; i++) {
|
||||||
id += urlAlphabet[pool[i] & 63]
|
id += urlAlphabet[pool[i] & 63]
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -4,8 +4,8 @@ import Action from './action';
|
||||||
|
|
||||||
describe('Action', () => {
|
describe('Action', () => {
|
||||||
describe('compatibility check', () => {
|
describe('compatibility check', () => {
|
||||||
it('throws for anything other than linux', () => {
|
it('throws for anything other than linux or windows', () => {
|
||||||
if (process.platform !== 'linux') {
|
if (process.platform !== 'linux' && process.platform !== 'win32') {
|
||||||
expect(() => Action.checkCompatibility()).toThrow();
|
expect(() => Action.checkCompatibility()).toThrow();
|
||||||
} else {
|
} else {
|
||||||
expect(() => Action.checkCompatibility()).not.toThrow();
|
expect(() => Action.checkCompatibility()).not.toThrow();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue