Fix action.test.ts to accept windows as a base platform

pull/305/head
Andrew Kahr 2022-01-21 17:54:36 -08:00
parent c63ab9855a
commit 18a1268d20
3 changed files with 146 additions and 138 deletions

58
dist/index.js vendored
View File

@ -129307,8 +129307,6 @@ module.exports.MaxBufferError = MaxBufferError;
/***/ 47625:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
exports.alphasort = alphasort
exports.alphasorti = alphasorti
exports.setopts = setopts
exports.ownProp = ownProp
exports.makeAbs = makeAbs
@ -129321,17 +129319,14 @@ function ownProp (obj, field) {
return Object.prototype.hasOwnProperty.call(obj, field)
}
var fs = __webpack_require__(35747)
var path = __webpack_require__(85622)
var minimatch = __webpack_require__(83973)
var isAbsolute = __webpack_require__(38714)
var Minimatch = minimatch.Minimatch
function alphasorti (a, b) {
return a.toLowerCase().localeCompare(b.toLowerCase())
}
function alphasort (a, b) {
return a.localeCompare(b)
return a.localeCompare(b, 'en')
}
function setupIgnores (self, options) {
@ -129390,6 +129385,7 @@ function setopts (self, pattern, options) {
self.stat = !!options.stat
self.noprocess = !!options.noprocess
self.absolute = !!options.absolute
self.fs = options.fs || fs
self.maxLength = options.maxLength || Infinity
self.cache = options.cache || Object.create(null)
@ -129459,7 +129455,7 @@ function finish (self) {
all = Object.keys(all)
if (!self.nosort)
all = all.sort(self.nocase ? alphasorti : alphasort)
all = all.sort(alphasort)
// at *some* point we statted all of these
if (self.mark) {
@ -129596,7 +129592,6 @@ function childrenIgnored (self, path) {
module.exports = glob
var fs = __webpack_require__(35747)
var rp = __webpack_require__(46863)
var minimatch = __webpack_require__(83973)
var Minimatch = minimatch.Minimatch
@ -129607,8 +129602,6 @@ var assert = __webpack_require__(42357)
var isAbsolute = __webpack_require__(38714)
var globSync = __webpack_require__(29010)
var common = __webpack_require__(47625)
var alphasort = common.alphasort
var alphasorti = common.alphasorti
var setopts = common.setopts
var ownProp = common.ownProp
var inflight = __webpack_require__(52492)
@ -130059,7 +130052,7 @@ Glob.prototype._readdirInGlobStar = function (abs, cb) {
var lstatcb = inflight(lstatkey, lstatcb_)
if (lstatcb)
fs.lstat(abs, lstatcb)
self.fs.lstat(abs, lstatcb)
function lstatcb_ (er, lstat) {
if (er && er.code === 'ENOENT')
@ -130100,7 +130093,7 @@ Glob.prototype._readdir = function (abs, inGlobStar, cb) {
}
var self = this
fs.readdir(abs, readdirCb(this, abs, cb))
self.fs.readdir(abs, readdirCb(this, abs, cb))
}
function readdirCb (self, abs, cb) {
@ -130304,13 +130297,13 @@ Glob.prototype._stat = function (f, cb) {
var self = this
var statcb = inflight('stat\0' + abs, lstatcb_)
if (statcb)
fs.lstat(abs, statcb)
self.fs.lstat(abs, statcb)
function lstatcb_ (er, lstat) {
if (lstat && lstat.isSymbolicLink()) {
// If it's a symlink, then treat it as the target, unless
// 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)
self._stat2(f, abs, null, lstat, cb)
else
@ -130354,7 +130347,6 @@ Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
module.exports = globSync
globSync.GlobSync = GlobSync
var fs = __webpack_require__(35747)
var rp = __webpack_require__(46863)
var minimatch = __webpack_require__(83973)
var Minimatch = minimatch.Minimatch
@ -130364,8 +130356,6 @@ var path = __webpack_require__(85622)
var assert = __webpack_require__(42357)
var isAbsolute = __webpack_require__(38714)
var common = __webpack_require__(47625)
var alphasort = common.alphasort
var alphasorti = common.alphasorti
var setopts = common.setopts
var ownProp = common.ownProp
var childrenIgnored = common.childrenIgnored
@ -130601,7 +130591,7 @@ GlobSync.prototype._readdirInGlobStar = function (abs) {
var lstat
var stat
try {
lstat = fs.lstatSync(abs)
lstat = this.fs.lstatSync(abs)
} catch (er) {
if (er.code === 'ENOENT') {
// lstat failed, doesn't exist
@ -130638,7 +130628,7 @@ GlobSync.prototype._readdir = function (abs, inGlobStar) {
}
try {
return this._readdirEntries(abs, fs.readdirSync(abs))
return this._readdirEntries(abs, this.fs.readdirSync(abs))
} catch (er) {
this._readdirError(abs, er)
return null
@ -130797,7 +130787,7 @@ GlobSync.prototype._stat = function (f) {
if (!stat) {
var lstat
try {
lstat = fs.lstatSync(abs)
lstat = this.fs.lstatSync(abs)
} catch (er) {
if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
this.statCache[abs] = false
@ -130807,7 +130797,7 @@ GlobSync.prototype._stat = function (f) {
if (lstat && lstat.isSymbolicLink()) {
try {
stat = fs.statSync(abs)
stat = this.fs.statSync(abs)
} catch (er) {
stat = lstat
}
@ -171654,7 +171644,24 @@ function execSync(cmd, opts, pipe) {
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 = [
__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
// and we locked down permissions (see the note above).
try { common.unlinkSync(paramsFile); } catch (e) {}
try { common.unlinkSync(stderrFile); } catch (e) {}
try { common.unlinkSync(stdoutFile); } catch (e) {}
@ -197280,7 +197288,7 @@ let fillPool = bytes => {
poolOffset += bytes
}
let random = bytes => {
fillPool(bytes)
fillPool((bytes -= 0))
return pool.subarray(poolOffset - bytes, poolOffset)
}
let customRandom = (alphabet, size, getRandom) => {
@ -197300,7 +197308,7 @@ let customRandom = (alphabet, size, getRandom) => {
}
let customAlphabet = (alphabet, size) => customRandom(alphabet, size, random)
let nanoid = (size = 21) => {
fillPool(size)
fillPool((size -= 0))
let id = ''
for (let i = poolOffset - size; i < poolOffset; i++) {
id += urlAlphabet[pool[i] & 63]

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -4,8 +4,8 @@ import Action from './action';
describe('Action', () => {
describe('compatibility check', () => {
it('throws for anything other than linux', () => {
if (process.platform !== 'linux') {
it('throws for anything other than linux or windows', () => {
if (process.platform !== 'linux' && process.platform !== 'win32') {
expect(() => Action.checkCompatibility()).toThrow();
} else {
expect(() => Action.checkCompatibility()).not.toThrow();