@wix/cli
Version:
CLI tool for building Wix sites and applications
146 lines (142 loc) • 4.09 kB
JavaScript
import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
__commonJS,
__require,
init_esm_shims
} from "./chunk-EXLZF52D.js";
// ../../node_modules/isexe/windows.js
var require_windows = __commonJS({
"../../node_modules/isexe/windows.js"(exports, module) {
"use strict";
init_esm_shims();
module.exports = isexe;
isexe.sync = sync;
var fs = __require("fs");
function checkPathExt(path, options) {
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
if (!pathext) {
return true;
}
pathext = pathext.split(";");
if (pathext.indexOf("") !== -1) {
return true;
}
for (var i = 0; i < pathext.length; i++) {
var p = pathext[i].toLowerCase();
if (p && path.substr(-p.length).toLowerCase() === p) {
return true;
}
}
return false;
}
function checkStat(stat, path, options) {
if (!stat.isSymbolicLink() && !stat.isFile()) {
return false;
}
return checkPathExt(path, options);
}
function isexe(path, options, cb) {
fs.stat(path, function(er, stat) {
cb(er, er ? false : checkStat(stat, path, options));
});
}
function sync(path, options) {
return checkStat(fs.statSync(path), path, options);
}
}
});
// ../../node_modules/isexe/mode.js
var require_mode = __commonJS({
"../../node_modules/isexe/mode.js"(exports, module) {
"use strict";
init_esm_shims();
module.exports = isexe;
isexe.sync = sync;
var fs = __require("fs");
function isexe(path, options, cb) {
fs.stat(path, function(er, stat) {
cb(er, er ? false : checkStat(stat, options));
});
}
function sync(path, options) {
return checkStat(fs.statSync(path), options);
}
function checkStat(stat, options) {
return stat.isFile() && checkMode(stat, options);
}
function checkMode(stat, options) {
var mod = stat.mode;
var uid = stat.uid;
var gid = stat.gid;
var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid();
var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid();
var u = parseInt("100", 8);
var g = parseInt("010", 8);
var o = parseInt("001", 8);
var ug = u | g;
var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && myUid === 0;
return ret;
}
}
});
// ../../node_modules/isexe/index.js
var require_isexe = __commonJS({
"../../node_modules/isexe/index.js"(exports, module) {
"use strict";
init_esm_shims();
var fs = __require("fs");
var core;
if (process.platform === "win32" || global.TESTING_WINDOWS) {
core = require_windows();
} else {
core = require_mode();
}
module.exports = isexe;
isexe.sync = sync;
function isexe(path, options, cb) {
if (typeof options === "function") {
cb = options;
options = {};
}
if (!cb) {
if (typeof Promise !== "function") {
throw new TypeError("callback not provided");
}
return new Promise(function(resolve, reject) {
isexe(path, options || {}, function(er, is) {
if (er) {
reject(er);
} else {
resolve(is);
}
});
});
}
core(path, options || {}, function(er, is) {
if (er) {
if (er.code === "EACCES" || options && options.ignoreErrors) {
er = null;
is = false;
}
}
cb(er, is);
});
}
function sync(path, options) {
try {
return core.sync(path, options || {});
} catch (er) {
if (options && options.ignoreErrors || er.code === "EACCES") {
return false;
} else {
throw er;
}
}
}
}
});
export {
require_isexe
};
//# sourceMappingURL=chunk-MHV22UIU.js.map