@capgo/cli 4.10.21 → 4.10.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/bun.lockb +0 -0
- package/dist/index.js +679 -663
- package/package.json +2 -1
- package/src/api/channels.ts +7 -1
- package/src/bundle/upload.ts +3 -7
- package/src/bundle/zip.ts +2 -4
- package/src/channel/add.ts +8 -2
- package/src/index.ts +1 -1
- package/src/init.ts +4 -4
- package/src/key.ts +2 -2
- package/src/utils.ts +14 -1
package/dist/index.js
CHANGED
|
@@ -6166,7 +6166,7 @@ var require_dist = __commonJS({
|
|
|
6166
6166
|
exports2.walk = exports2.Walker = exports2.compilePaths = exports2.tmpfilepath = exports2.findBaseDirectory = exports2.isExecutableFile = exports2.pathExecutable = exports2.pathWritable = exports2.pathReadable = exports2.pathExists = exports2.pathAccessible = exports2.writeStreamToFile = exports2.cacheFileChecksum = exports2.getFileChecksums = exports2.getFileChecksum = exports2.fileToString = exports2.getFileTree = exports2.readdirp = exports2.readdirSafe = exports2.statSafe = void 0;
|
|
6167
6167
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
6168
6168
|
var fs6 = require_lib();
|
|
6169
|
-
var
|
|
6169
|
+
var os4 = require("os");
|
|
6170
6170
|
var path3 = require("path");
|
|
6171
6171
|
var stream = require("stream");
|
|
6172
6172
|
var safe = require_safe();
|
|
@@ -6339,7 +6339,7 @@ var require_dist = __commonJS({
|
|
|
6339
6339
|
exports2.findBaseDirectory = findBaseDirectory;
|
|
6340
6340
|
function tmpfilepath(prefix) {
|
|
6341
6341
|
const rn = Math.random().toString(16).substring(2, 8);
|
|
6342
|
-
const p2 = path3.resolve(
|
|
6342
|
+
const p2 = path3.resolve(os4.tmpdir(), prefix ? `${prefix}-${rn}` : rn);
|
|
6343
6343
|
return p2;
|
|
6344
6344
|
}
|
|
6345
6345
|
exports2.tmpfilepath = tmpfilepath;
|
|
@@ -6867,7 +6867,7 @@ var require_has_flag = __commonJS({
|
|
|
6867
6867
|
var require_supports_color = __commonJS({
|
|
6868
6868
|
"node_modules/supports-color/index.js"(exports2, module2) {
|
|
6869
6869
|
"use strict";
|
|
6870
|
-
var
|
|
6870
|
+
var os4 = require("os");
|
|
6871
6871
|
var tty = require("tty");
|
|
6872
6872
|
var hasFlag = require_has_flag();
|
|
6873
6873
|
var { env } = process;
|
|
@@ -6915,7 +6915,7 @@ var require_supports_color = __commonJS({
|
|
|
6915
6915
|
return min;
|
|
6916
6916
|
}
|
|
6917
6917
|
if (process.platform === "win32") {
|
|
6918
|
-
const osRelease =
|
|
6918
|
+
const osRelease = os4.release().split(".");
|
|
6919
6919
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
6920
6920
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
6921
6921
|
}
|
|
@@ -9027,8 +9027,8 @@ var require_wrap_ansi = __commonJS({
|
|
|
9027
9027
|
var require_untildify = __commonJS({
|
|
9028
9028
|
"node_modules/untildify/index.js"(exports2, module2) {
|
|
9029
9029
|
"use strict";
|
|
9030
|
-
var
|
|
9031
|
-
var homeDirectory =
|
|
9030
|
+
var os4 = require("os");
|
|
9031
|
+
var homeDirectory = os4.homedir();
|
|
9032
9032
|
module2.exports = (pathWithTilde) => {
|
|
9033
9033
|
if (typeof pathWithTilde !== "string") {
|
|
9034
9034
|
throw new TypeError(`Expected a string, got ${typeof pathWithTilde}`);
|
|
@@ -9045,7 +9045,7 @@ var require_format = __commonJS({
|
|
|
9045
9045
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
9046
9046
|
exports2.columnar = exports2.generateFillSpaceStringList = exports2.expandPath = exports2.prettyPath = exports2.wordWrap = exports2.indent = exports2.TTY_WIDTH = exports2.stripAnsi = exports2.stringWidth = exports2.sliceAnsi = void 0;
|
|
9047
9047
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
9048
|
-
var
|
|
9048
|
+
var os4 = tslib_1.__importStar(require("os"));
|
|
9049
9049
|
var path3 = tslib_1.__importStar(require("path"));
|
|
9050
9050
|
var sliceAnsi = require_slice_ansi();
|
|
9051
9051
|
exports2.sliceAnsi = sliceAnsi;
|
|
@@ -9071,7 +9071,7 @@ ${indent(indentation)}`);
|
|
|
9071
9071
|
p2 = expandPath(p2);
|
|
9072
9072
|
const cwd = process.cwd();
|
|
9073
9073
|
const d3 = path3.dirname(p2);
|
|
9074
|
-
const h3 =
|
|
9074
|
+
const h3 = os4.homedir();
|
|
9075
9075
|
const distanceFromCwd = Math.abs(d3.split(path3.sep).length - cwd.split(path3.sep).length);
|
|
9076
9076
|
if (cwd === d3) {
|
|
9077
9077
|
return "." + path3.sep + path3.basename(p2);
|
|
@@ -9155,12 +9155,12 @@ var require_info = __commonJS({
|
|
|
9155
9155
|
exports2.TERMINAL_INFO = exports2.CI_ENVIRONMENT_VARIABLES_DETECTED = exports2.CI_ENVIRONMENT_VARIABLES = void 0;
|
|
9156
9156
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
9157
9157
|
var debug_1 = require_src2();
|
|
9158
|
-
var
|
|
9158
|
+
var os4 = tslib_1.__importStar(require("os"));
|
|
9159
9159
|
var debug = (0, debug_1.debug)("ionic:utils-terminal:info");
|
|
9160
9160
|
exports2.CI_ENVIRONMENT_VARIABLES = ["CI", "BUILD_ID", "BUILD_NUMBER", "BITBUCKET_COMMIT", "CODEBUILD_BUILD_ARN", "GITHUB_ACTIONS"];
|
|
9161
9161
|
exports2.CI_ENVIRONMENT_VARIABLES_DETECTED = exports2.CI_ENVIRONMENT_VARIABLES.filter((v2) => !!process.env[v2]);
|
|
9162
9162
|
function getShell() {
|
|
9163
|
-
const { shell } =
|
|
9163
|
+
const { shell } = os4.userInfo();
|
|
9164
9164
|
if (shell) {
|
|
9165
9165
|
return shell;
|
|
9166
9166
|
}
|
|
@@ -14903,7 +14903,7 @@ var require_dist6 = __commonJS({
|
|
|
14903
14903
|
exports2.walk = exports2.Walker = exports2.compilePaths = exports2.tmpfilepath = exports2.findBaseDirectory = exports2.isExecutableFile = exports2.pathExecutable = exports2.pathWritable = exports2.pathReadable = exports2.pathExists = exports2.pathAccessible = exports2.writeStreamToFile = exports2.cacheFileChecksum = exports2.getFileChecksums = exports2.getFileChecksum = exports2.fileToString = exports2.getFileTree = exports2.readdirp = exports2.readdirSafe = exports2.statSafe = void 0;
|
|
14904
14904
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
14905
14905
|
var fs6 = require_lib();
|
|
14906
|
-
var
|
|
14906
|
+
var os4 = require("os");
|
|
14907
14907
|
var path3 = require("path");
|
|
14908
14908
|
var stream = require("stream");
|
|
14909
14909
|
var safe = require_safe2();
|
|
@@ -15076,7 +15076,7 @@ var require_dist6 = __commonJS({
|
|
|
15076
15076
|
exports2.findBaseDirectory = findBaseDirectory;
|
|
15077
15077
|
function tmpfilepath(prefix) {
|
|
15078
15078
|
const rn = Math.random().toString(16).substring(2, 8);
|
|
15079
|
-
const p2 = path3.resolve(
|
|
15079
|
+
const p2 = path3.resolve(os4.tmpdir(), prefix ? `${prefix}-${rn}` : rn);
|
|
15080
15080
|
return p2;
|
|
15081
15081
|
}
|
|
15082
15082
|
exports2.tmpfilepath = tmpfilepath;
|
|
@@ -15273,7 +15273,7 @@ var require_format2 = __commonJS({
|
|
|
15273
15273
|
"use strict";
|
|
15274
15274
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
15275
15275
|
exports2.columnar = exports2.generateFillSpaceStringList = exports2.expandPath = exports2.prettyPath = exports2.wordWrap = exports2.indent = exports2.TTY_WIDTH = exports2.stripAnsi = exports2.stringWidth = exports2.sliceAnsi = void 0;
|
|
15276
|
-
var
|
|
15276
|
+
var os4 = require("os");
|
|
15277
15277
|
var path3 = require("path");
|
|
15278
15278
|
var sliceAnsi = require_slice_ansi();
|
|
15279
15279
|
exports2.sliceAnsi = sliceAnsi;
|
|
@@ -15299,7 +15299,7 @@ ${indent(indentation)}`);
|
|
|
15299
15299
|
p2 = expandPath(p2);
|
|
15300
15300
|
const cwd = process.cwd();
|
|
15301
15301
|
const d3 = path3.dirname(p2);
|
|
15302
|
-
const h3 =
|
|
15302
|
+
const h3 = os4.homedir();
|
|
15303
15303
|
const distanceFromCwd = Math.abs(d3.split(path3.sep).length - cwd.split(path3.sep).length);
|
|
15304
15304
|
if (cwd === d3) {
|
|
15305
15305
|
return "." + path3.sep + path3.basename(p2);
|
|
@@ -15382,12 +15382,12 @@ var require_info2 = __commonJS({
|
|
|
15382
15382
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
15383
15383
|
exports2.TERMINAL_INFO = exports2.CI_ENVIRONMENT_VARIABLES_DETECTED = exports2.CI_ENVIRONMENT_VARIABLES = void 0;
|
|
15384
15384
|
var Debug = require_src2();
|
|
15385
|
-
var
|
|
15385
|
+
var os4 = require("os");
|
|
15386
15386
|
var debug = Debug("ionic:utils-terminal:info");
|
|
15387
15387
|
exports2.CI_ENVIRONMENT_VARIABLES = ["CI", "BUILD_ID", "BUILD_NUMBER", "BITBUCKET_COMMIT", "CODEBUILD_BUILD_ARN", "GITHUB_ACTIONS"];
|
|
15388
15388
|
exports2.CI_ENVIRONMENT_VARIABLES_DETECTED = exports2.CI_ENVIRONMENT_VARIABLES.filter((v2) => !!process.env[v2]);
|
|
15389
15389
|
function getShell() {
|
|
15390
|
-
const { shell } =
|
|
15390
|
+
const { shell } = os4.userInfo();
|
|
15391
15391
|
if (shell) {
|
|
15392
15392
|
return shell;
|
|
15393
15393
|
}
|
|
@@ -16274,14 +16274,14 @@ var require_dist11 = __commonJS({
|
|
|
16274
16274
|
var utils_terminal_1 = require_dist8();
|
|
16275
16275
|
var child_process_1 = require("child_process");
|
|
16276
16276
|
var crossSpawn = require_cross_spawn();
|
|
16277
|
-
var
|
|
16277
|
+
var os4 = require("os");
|
|
16278
16278
|
var pathlib = require("path");
|
|
16279
16279
|
exports2.ERROR_COMMAND_NOT_FOUND = "ERR_SUBPROCESS_COMMAND_NOT_FOUND";
|
|
16280
16280
|
exports2.ERROR_NON_ZERO_EXIT = "ERR_SUBPROCESS_NON_ZERO_EXIT";
|
|
16281
16281
|
exports2.ERROR_SIGNAL_EXIT = "ERR_SUBPROCESS_SIGNAL_EXIT";
|
|
16282
16282
|
exports2.TILDE_PATH_REGEX = /^~($|\/|\\)/;
|
|
16283
16283
|
function expandTildePath(p2) {
|
|
16284
|
-
const h3 =
|
|
16284
|
+
const h3 = os4.homedir();
|
|
16285
16285
|
return p2.replace(exports2.TILDE_PATH_REGEX, `${h3}$1`);
|
|
16286
16286
|
}
|
|
16287
16287
|
exports2.expandTildePath = expandTildePath;
|
|
@@ -19675,8 +19675,8 @@ ${(_a = e2.stack) !== null && _a !== void 0 ? _a : e2}`);
|
|
|
19675
19675
|
platformDirAbs
|
|
19676
19676
|
};
|
|
19677
19677
|
}
|
|
19678
|
-
function determineOS(
|
|
19679
|
-
switch (
|
|
19678
|
+
function determineOS(os4) {
|
|
19679
|
+
switch (os4) {
|
|
19680
19680
|
case "darwin":
|
|
19681
19681
|
return "mac";
|
|
19682
19682
|
case "win32":
|
|
@@ -19704,11 +19704,11 @@ Please follow the Upgrade Guide to move ${colors_1.default.strong("public")} ins
|
|
|
19704
19704
|
}
|
|
19705
19705
|
return (0, path_1.resolve)(nativeTargetDirAbs, "public");
|
|
19706
19706
|
}
|
|
19707
|
-
async function determineAndroidStudioPath(
|
|
19707
|
+
async function determineAndroidStudioPath(os4) {
|
|
19708
19708
|
if (process.env.CAPACITOR_ANDROID_STUDIO_PATH) {
|
|
19709
19709
|
return process.env.CAPACITOR_ANDROID_STUDIO_PATH;
|
|
19710
19710
|
}
|
|
19711
|
-
switch (
|
|
19711
|
+
switch (os4) {
|
|
19712
19712
|
case "mac":
|
|
19713
19713
|
return "/Applications/Android Studio.app";
|
|
19714
19714
|
case "windows": {
|
|
@@ -33811,7 +33811,7 @@ var require_has_flag2 = __commonJS({
|
|
|
33811
33811
|
var require_supports_colors = __commonJS({
|
|
33812
33812
|
"node_modules/colors/lib/system/supports-colors.js"(exports2, module2) {
|
|
33813
33813
|
"use strict";
|
|
33814
|
-
var
|
|
33814
|
+
var os4 = require("os");
|
|
33815
33815
|
var hasFlag = require_has_flag2();
|
|
33816
33816
|
var env = process.env;
|
|
33817
33817
|
var forceColor = void 0;
|
|
@@ -33849,7 +33849,7 @@ var require_supports_colors = __commonJS({
|
|
|
33849
33849
|
}
|
|
33850
33850
|
var min = forceColor ? 1 : 0;
|
|
33851
33851
|
if (process.platform === "win32") {
|
|
33852
|
-
var osRelease =
|
|
33852
|
+
var osRelease = os4.release().split(".");
|
|
33853
33853
|
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
33854
33854
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
33855
33855
|
}
|
|
@@ -41667,11 +41667,11 @@ var require_utimes2 = __commonJS({
|
|
|
41667
41667
|
"node_modules/@manypkg/find-root/node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
|
|
41668
41668
|
"use strict";
|
|
41669
41669
|
var fs6 = require_graceful_fs();
|
|
41670
|
-
var
|
|
41670
|
+
var os4 = require("os");
|
|
41671
41671
|
var path3 = require("path");
|
|
41672
41672
|
function hasMillisResSync() {
|
|
41673
41673
|
let tmpfile = path3.join("millis-test-sync" + Date.now().toString() + Math.random().toString().slice(2));
|
|
41674
|
-
tmpfile = path3.join(
|
|
41674
|
+
tmpfile = path3.join(os4.tmpdir(), tmpfile);
|
|
41675
41675
|
const d3 = /* @__PURE__ */ new Date(1435410243862);
|
|
41676
41676
|
fs6.writeFileSync(tmpfile, "https://github.com/jprichardson/node-fs-extra/pull/141");
|
|
41677
41677
|
const fd = fs6.openSync(tmpfile, "r+");
|
|
@@ -41681,7 +41681,7 @@ var require_utimes2 = __commonJS({
|
|
|
41681
41681
|
}
|
|
41682
41682
|
function hasMillisRes(callback) {
|
|
41683
41683
|
let tmpfile = path3.join("millis-test" + Date.now().toString() + Math.random().toString().slice(2));
|
|
41684
|
-
tmpfile = path3.join(
|
|
41684
|
+
tmpfile = path3.join(os4.tmpdir(), tmpfile);
|
|
41685
41685
|
const d3 = /* @__PURE__ */ new Date(1435410243862);
|
|
41686
41686
|
fs6.writeFile(tmpfile, "https://github.com/jprichardson/node-fs-extra/pull/141", (err) => {
|
|
41687
41687
|
if (err) return callback(err);
|
|
@@ -43540,11 +43540,11 @@ var require_utimes3 = __commonJS({
|
|
|
43540
43540
|
"node_modules/@manypkg/tools/node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) {
|
|
43541
43541
|
"use strict";
|
|
43542
43542
|
var fs6 = require_graceful_fs();
|
|
43543
|
-
var
|
|
43543
|
+
var os4 = require("os");
|
|
43544
43544
|
var path3 = require("path");
|
|
43545
43545
|
function hasMillisResSync() {
|
|
43546
43546
|
let tmpfile = path3.join("millis-test-sync" + Date.now().toString() + Math.random().toString().slice(2));
|
|
43547
|
-
tmpfile = path3.join(
|
|
43547
|
+
tmpfile = path3.join(os4.tmpdir(), tmpfile);
|
|
43548
43548
|
const d3 = /* @__PURE__ */ new Date(1435410243862);
|
|
43549
43549
|
fs6.writeFileSync(tmpfile, "https://github.com/jprichardson/node-fs-extra/pull/141");
|
|
43550
43550
|
const fd = fs6.openSync(tmpfile, "r+");
|
|
@@ -43554,7 +43554,7 @@ var require_utimes3 = __commonJS({
|
|
|
43554
43554
|
}
|
|
43555
43555
|
function hasMillisRes(callback) {
|
|
43556
43556
|
let tmpfile = path3.join("millis-test" + Date.now().toString() + Math.random().toString().slice(2));
|
|
43557
|
-
tmpfile = path3.join(
|
|
43557
|
+
tmpfile = path3.join(os4.tmpdir(), tmpfile);
|
|
43558
43558
|
const d3 = /* @__PURE__ */ new Date(1435410243862);
|
|
43559
43559
|
fs6.writeFile(tmpfile, "https://github.com/jprichardson/node-fs-extra/pull/141", (err) => {
|
|
43560
43560
|
if (err) return callback(err);
|
|
@@ -45347,9 +45347,9 @@ var require_path = __commonJS({
|
|
|
45347
45347
|
"use strict";
|
|
45348
45348
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
45349
45349
|
exports2.convertPosixPathToPattern = exports2.convertWindowsPathToPattern = exports2.convertPathToPattern = exports2.escapePosixPath = exports2.escapeWindowsPath = exports2.escape = exports2.removeLeadingDotSegment = exports2.makeAbsolute = exports2.unixify = void 0;
|
|
45350
|
-
var
|
|
45350
|
+
var os4 = require("os");
|
|
45351
45351
|
var path3 = require("path");
|
|
45352
|
-
var IS_WINDOWS_PLATFORM =
|
|
45352
|
+
var IS_WINDOWS_PLATFORM = os4.platform() === "win32";
|
|
45353
45353
|
var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
|
|
45354
45354
|
var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
|
|
45355
45355
|
var WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g;
|
|
@@ -50423,8 +50423,8 @@ var require_settings4 = __commonJS({
|
|
|
50423
50423
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
50424
50424
|
exports2.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
50425
50425
|
var fs6 = require("fs");
|
|
50426
|
-
var
|
|
50427
|
-
var CPU_COUNT = Math.max(
|
|
50426
|
+
var os4 = require("os");
|
|
50427
|
+
var CPU_COUNT = Math.max(os4.cpus().length, 1);
|
|
50428
50428
|
exports2.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
50429
50429
|
lstat: fs6.lstat,
|
|
50430
50430
|
lstatSync: fs6.lstatSync,
|
|
@@ -56865,516 +56865,6 @@ var require_manypkg_find_root_cjs = __commonJS({
|
|
|
56865
56865
|
}
|
|
56866
56866
|
});
|
|
56867
56867
|
|
|
56868
|
-
// node_modules/is-inside-container/node_modules/is-docker/index.js
|
|
56869
|
-
function hasDockerEnv() {
|
|
56870
|
-
try {
|
|
56871
|
-
import_node_fs.default.statSync("/.dockerenv");
|
|
56872
|
-
return true;
|
|
56873
|
-
} catch {
|
|
56874
|
-
return false;
|
|
56875
|
-
}
|
|
56876
|
-
}
|
|
56877
|
-
function hasDockerCGroup() {
|
|
56878
|
-
try {
|
|
56879
|
-
return import_node_fs.default.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
56880
|
-
} catch {
|
|
56881
|
-
return false;
|
|
56882
|
-
}
|
|
56883
|
-
}
|
|
56884
|
-
function isDocker() {
|
|
56885
|
-
if (isDockerCached === void 0) {
|
|
56886
|
-
isDockerCached = hasDockerEnv() || hasDockerCGroup();
|
|
56887
|
-
}
|
|
56888
|
-
return isDockerCached;
|
|
56889
|
-
}
|
|
56890
|
-
var import_node_fs, isDockerCached;
|
|
56891
|
-
var init_is_docker = __esm({
|
|
56892
|
-
"node_modules/is-inside-container/node_modules/is-docker/index.js"() {
|
|
56893
|
-
import_node_fs = __toESM(require("node:fs"), 1);
|
|
56894
|
-
}
|
|
56895
|
-
});
|
|
56896
|
-
|
|
56897
|
-
// node_modules/is-inside-container/index.js
|
|
56898
|
-
function isInsideContainer() {
|
|
56899
|
-
if (cachedResult === void 0) {
|
|
56900
|
-
cachedResult = hasContainerEnv() || isDocker();
|
|
56901
|
-
}
|
|
56902
|
-
return cachedResult;
|
|
56903
|
-
}
|
|
56904
|
-
var import_node_fs2, cachedResult, hasContainerEnv;
|
|
56905
|
-
var init_is_inside_container = __esm({
|
|
56906
|
-
"node_modules/is-inside-container/index.js"() {
|
|
56907
|
-
import_node_fs2 = __toESM(require("node:fs"), 1);
|
|
56908
|
-
init_is_docker();
|
|
56909
|
-
hasContainerEnv = () => {
|
|
56910
|
-
try {
|
|
56911
|
-
import_node_fs2.default.statSync("/run/.containerenv");
|
|
56912
|
-
return true;
|
|
56913
|
-
} catch {
|
|
56914
|
-
return false;
|
|
56915
|
-
}
|
|
56916
|
-
};
|
|
56917
|
-
}
|
|
56918
|
-
});
|
|
56919
|
-
|
|
56920
|
-
// node_modules/is-wsl/index.js
|
|
56921
|
-
var import_node_process3, import_node_os, import_node_fs3, isWsl, is_wsl_default;
|
|
56922
|
-
var init_is_wsl = __esm({
|
|
56923
|
-
"node_modules/is-wsl/index.js"() {
|
|
56924
|
-
import_node_process3 = __toESM(require("node:process"), 1);
|
|
56925
|
-
import_node_os = __toESM(require("node:os"), 1);
|
|
56926
|
-
import_node_fs3 = __toESM(require("node:fs"), 1);
|
|
56927
|
-
init_is_inside_container();
|
|
56928
|
-
isWsl = () => {
|
|
56929
|
-
if (import_node_process3.default.platform !== "linux") {
|
|
56930
|
-
return false;
|
|
56931
|
-
}
|
|
56932
|
-
if (import_node_os.default.release().toLowerCase().includes("microsoft")) {
|
|
56933
|
-
if (isInsideContainer()) {
|
|
56934
|
-
return false;
|
|
56935
|
-
}
|
|
56936
|
-
return true;
|
|
56937
|
-
}
|
|
56938
|
-
try {
|
|
56939
|
-
return import_node_fs3.default.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
|
|
56940
|
-
} catch {
|
|
56941
|
-
return false;
|
|
56942
|
-
}
|
|
56943
|
-
};
|
|
56944
|
-
is_wsl_default = import_node_process3.default.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
56945
|
-
}
|
|
56946
|
-
});
|
|
56947
|
-
|
|
56948
|
-
// node_modules/define-lazy-prop/index.js
|
|
56949
|
-
function defineLazyProperty(object, propertyName, valueGetter) {
|
|
56950
|
-
const define2 = (value) => Object.defineProperty(object, propertyName, { value, enumerable: true, writable: true });
|
|
56951
|
-
Object.defineProperty(object, propertyName, {
|
|
56952
|
-
configurable: true,
|
|
56953
|
-
enumerable: true,
|
|
56954
|
-
get() {
|
|
56955
|
-
const result = valueGetter();
|
|
56956
|
-
define2(result);
|
|
56957
|
-
return result;
|
|
56958
|
-
},
|
|
56959
|
-
set(value) {
|
|
56960
|
-
define2(value);
|
|
56961
|
-
}
|
|
56962
|
-
});
|
|
56963
|
-
return object;
|
|
56964
|
-
}
|
|
56965
|
-
var init_define_lazy_prop = __esm({
|
|
56966
|
-
"node_modules/define-lazy-prop/index.js"() {
|
|
56967
|
-
}
|
|
56968
|
-
});
|
|
56969
|
-
|
|
56970
|
-
// node_modules/default-browser-id/index.js
|
|
56971
|
-
async function defaultBrowserId() {
|
|
56972
|
-
if (import_node_process4.default.platform !== "darwin") {
|
|
56973
|
-
throw new Error("macOS only");
|
|
56974
|
-
}
|
|
56975
|
-
const { stdout } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
|
|
56976
|
-
const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
|
|
56977
|
-
return match?.groups.id ?? "com.apple.Safari";
|
|
56978
|
-
}
|
|
56979
|
-
var import_node_util, import_node_process4, import_node_child_process, execFileAsync;
|
|
56980
|
-
var init_default_browser_id = __esm({
|
|
56981
|
-
"node_modules/default-browser-id/index.js"() {
|
|
56982
|
-
import_node_util = require("node:util");
|
|
56983
|
-
import_node_process4 = __toESM(require("node:process"), 1);
|
|
56984
|
-
import_node_child_process = require("node:child_process");
|
|
56985
|
-
execFileAsync = (0, import_node_util.promisify)(import_node_child_process.execFile);
|
|
56986
|
-
}
|
|
56987
|
-
});
|
|
56988
|
-
|
|
56989
|
-
// node_modules/run-applescript/index.js
|
|
56990
|
-
async function runAppleScript(script, { humanReadableOutput = true } = {}) {
|
|
56991
|
-
if (import_node_process5.default.platform !== "darwin") {
|
|
56992
|
-
throw new Error("macOS only");
|
|
56993
|
-
}
|
|
56994
|
-
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
56995
|
-
const { stdout } = await execFileAsync2("osascript", ["-e", script, outputArguments]);
|
|
56996
|
-
return stdout.trim();
|
|
56997
|
-
}
|
|
56998
|
-
var import_node_process5, import_node_util2, import_node_child_process2, execFileAsync2;
|
|
56999
|
-
var init_run_applescript = __esm({
|
|
57000
|
-
"node_modules/run-applescript/index.js"() {
|
|
57001
|
-
import_node_process5 = __toESM(require("node:process"), 1);
|
|
57002
|
-
import_node_util2 = require("node:util");
|
|
57003
|
-
import_node_child_process2 = require("node:child_process");
|
|
57004
|
-
execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
|
|
57005
|
-
}
|
|
57006
|
-
});
|
|
57007
|
-
|
|
57008
|
-
// node_modules/bundle-name/index.js
|
|
57009
|
-
async function bundleName(bundleId) {
|
|
57010
|
-
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string
|
|
57011
|
-
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
57012
|
-
}
|
|
57013
|
-
var init_bundle_name = __esm({
|
|
57014
|
-
"node_modules/bundle-name/index.js"() {
|
|
57015
|
-
init_run_applescript();
|
|
57016
|
-
}
|
|
57017
|
-
});
|
|
57018
|
-
|
|
57019
|
-
// node_modules/default-browser/windows.js
|
|
57020
|
-
async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
57021
|
-
const { stdout } = await _execFileAsync("reg", [
|
|
57022
|
-
"QUERY",
|
|
57023
|
-
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
57024
|
-
"/v",
|
|
57025
|
-
"ProgId"
|
|
57026
|
-
]);
|
|
57027
|
-
const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
|
|
57028
|
-
if (!match) {
|
|
57029
|
-
throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
|
|
57030
|
-
}
|
|
57031
|
-
const { id } = match.groups;
|
|
57032
|
-
const browser = windowsBrowserProgIds[id];
|
|
57033
|
-
if (!browser) {
|
|
57034
|
-
throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
|
|
57035
|
-
}
|
|
57036
|
-
return browser;
|
|
57037
|
-
}
|
|
57038
|
-
var import_node_util3, import_node_child_process3, execFileAsync3, windowsBrowserProgIds, UnknownBrowserError;
|
|
57039
|
-
var init_windows = __esm({
|
|
57040
|
-
"node_modules/default-browser/windows.js"() {
|
|
57041
|
-
import_node_util3 = require("node:util");
|
|
57042
|
-
import_node_child_process3 = require("node:child_process");
|
|
57043
|
-
execFileAsync3 = (0, import_node_util3.promisify)(import_node_child_process3.execFile);
|
|
57044
|
-
windowsBrowserProgIds = {
|
|
57045
|
-
AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
|
|
57046
|
-
MSEdgeDHTML: { name: "Edge", id: "com.microsoft.edge" },
|
|
57047
|
-
// On macOS, it's "com.microsoft.edgemac"
|
|
57048
|
-
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
|
|
57049
|
-
// Newer Edge/Win10 releases
|
|
57050
|
-
"IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" },
|
|
57051
|
-
FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
|
|
57052
|
-
ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
|
|
57053
|
-
BraveHTML: { name: "Brave", id: "com.brave.Browser" },
|
|
57054
|
-
BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
|
|
57055
|
-
BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" }
|
|
57056
|
-
};
|
|
57057
|
-
UnknownBrowserError = class extends Error {
|
|
57058
|
-
};
|
|
57059
|
-
}
|
|
57060
|
-
});
|
|
57061
|
-
|
|
57062
|
-
// node_modules/default-browser/index.js
|
|
57063
|
-
async function defaultBrowser2() {
|
|
57064
|
-
if (import_node_process6.default.platform === "darwin") {
|
|
57065
|
-
const id = await defaultBrowserId();
|
|
57066
|
-
const name = await bundleName(id);
|
|
57067
|
-
return { name, id };
|
|
57068
|
-
}
|
|
57069
|
-
if (import_node_process6.default.platform === "linux") {
|
|
57070
|
-
const { stdout } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
|
|
57071
|
-
const id = stdout.trim();
|
|
57072
|
-
const name = titleize(id.replace(/.desktop$/, "").replace("-", " "));
|
|
57073
|
-
return { name, id };
|
|
57074
|
-
}
|
|
57075
|
-
if (import_node_process6.default.platform === "win32") {
|
|
57076
|
-
return defaultBrowser();
|
|
57077
|
-
}
|
|
57078
|
-
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
57079
|
-
}
|
|
57080
|
-
var import_node_util4, import_node_process6, import_node_child_process4, execFileAsync4, titleize;
|
|
57081
|
-
var init_default_browser = __esm({
|
|
57082
|
-
"node_modules/default-browser/index.js"() {
|
|
57083
|
-
import_node_util4 = require("node:util");
|
|
57084
|
-
import_node_process6 = __toESM(require("node:process"), 1);
|
|
57085
|
-
import_node_child_process4 = require("node:child_process");
|
|
57086
|
-
init_default_browser_id();
|
|
57087
|
-
init_bundle_name();
|
|
57088
|
-
init_windows();
|
|
57089
|
-
execFileAsync4 = (0, import_node_util4.promisify)(import_node_child_process4.execFile);
|
|
57090
|
-
titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x3) => x3.toUpperCase());
|
|
57091
|
-
}
|
|
57092
|
-
});
|
|
57093
|
-
|
|
57094
|
-
// node_modules/open/index.js
|
|
57095
|
-
var open_exports = {};
|
|
57096
|
-
__export(open_exports, {
|
|
57097
|
-
apps: () => apps,
|
|
57098
|
-
default: () => open_default,
|
|
57099
|
-
openApp: () => openApp
|
|
57100
|
-
});
|
|
57101
|
-
function detectArchBinary(binary) {
|
|
57102
|
-
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
57103
|
-
return binary;
|
|
57104
|
-
}
|
|
57105
|
-
const { [arch]: archBinary } = binary;
|
|
57106
|
-
if (!archBinary) {
|
|
57107
|
-
throw new Error(`${arch} is not supported`);
|
|
57108
|
-
}
|
|
57109
|
-
return archBinary;
|
|
57110
|
-
}
|
|
57111
|
-
function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
|
|
57112
|
-
if (wsl && is_wsl_default) {
|
|
57113
|
-
return detectArchBinary(wsl);
|
|
57114
|
-
}
|
|
57115
|
-
if (!platformBinary) {
|
|
57116
|
-
throw new Error(`${platform} is not supported`);
|
|
57117
|
-
}
|
|
57118
|
-
return detectArchBinary(platformBinary);
|
|
57119
|
-
}
|
|
57120
|
-
var import_node_process7, import_node_buffer, import_node_path, import_node_url, import_node_child_process5, import_promises, import_meta, __dirname2, localXdgOpenPath, platform, arch, getWslDrivesMountPoint, pTryEach, baseOpen, open, openApp, apps, open_default;
|
|
57121
|
-
var init_open = __esm({
|
|
57122
|
-
"node_modules/open/index.js"() {
|
|
57123
|
-
import_node_process7 = __toESM(require("node:process"), 1);
|
|
57124
|
-
import_node_buffer = require("node:buffer");
|
|
57125
|
-
import_node_path = __toESM(require("node:path"), 1);
|
|
57126
|
-
import_node_url = require("node:url");
|
|
57127
|
-
import_node_child_process5 = __toESM(require("node:child_process"), 1);
|
|
57128
|
-
import_promises = __toESM(require("node:fs/promises"), 1);
|
|
57129
|
-
init_is_wsl();
|
|
57130
|
-
init_define_lazy_prop();
|
|
57131
|
-
init_default_browser();
|
|
57132
|
-
init_is_inside_container();
|
|
57133
|
-
import_meta = {};
|
|
57134
|
-
__dirname2 = import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
57135
|
-
localXdgOpenPath = import_node_path.default.join(__dirname2, "xdg-open");
|
|
57136
|
-
({ platform, arch } = import_node_process7.default);
|
|
57137
|
-
getWslDrivesMountPoint = /* @__PURE__ */ (() => {
|
|
57138
|
-
const defaultMountPoint = "/mnt/";
|
|
57139
|
-
let mountPoint;
|
|
57140
|
-
return async function() {
|
|
57141
|
-
if (mountPoint) {
|
|
57142
|
-
return mountPoint;
|
|
57143
|
-
}
|
|
57144
|
-
const configFilePath = "/etc/wsl.conf";
|
|
57145
|
-
let isConfigFileExists = false;
|
|
57146
|
-
try {
|
|
57147
|
-
await import_promises.default.access(configFilePath, import_promises.constants.F_OK);
|
|
57148
|
-
isConfigFileExists = true;
|
|
57149
|
-
} catch {
|
|
57150
|
-
}
|
|
57151
|
-
if (!isConfigFileExists) {
|
|
57152
|
-
return defaultMountPoint;
|
|
57153
|
-
}
|
|
57154
|
-
const configContent = await import_promises.default.readFile(configFilePath, { encoding: "utf8" });
|
|
57155
|
-
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
57156
|
-
if (!configMountPoint) {
|
|
57157
|
-
return defaultMountPoint;
|
|
57158
|
-
}
|
|
57159
|
-
mountPoint = configMountPoint.groups.mountPoint.trim();
|
|
57160
|
-
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
57161
|
-
return mountPoint;
|
|
57162
|
-
};
|
|
57163
|
-
})();
|
|
57164
|
-
pTryEach = async (array, mapper) => {
|
|
57165
|
-
let latestError;
|
|
57166
|
-
for (const item of array) {
|
|
57167
|
-
try {
|
|
57168
|
-
return await mapper(item);
|
|
57169
|
-
} catch (error) {
|
|
57170
|
-
latestError = error;
|
|
57171
|
-
}
|
|
57172
|
-
}
|
|
57173
|
-
throw latestError;
|
|
57174
|
-
};
|
|
57175
|
-
baseOpen = async (options) => {
|
|
57176
|
-
options = {
|
|
57177
|
-
wait: false,
|
|
57178
|
-
background: false,
|
|
57179
|
-
newInstance: false,
|
|
57180
|
-
allowNonzeroExitCode: false,
|
|
57181
|
-
...options
|
|
57182
|
-
};
|
|
57183
|
-
if (Array.isArray(options.app)) {
|
|
57184
|
-
return pTryEach(options.app, (singleApp) => baseOpen({
|
|
57185
|
-
...options,
|
|
57186
|
-
app: singleApp
|
|
57187
|
-
}));
|
|
57188
|
-
}
|
|
57189
|
-
let { name: app2, arguments: appArguments = [] } = options.app ?? {};
|
|
57190
|
-
appArguments = [...appArguments];
|
|
57191
|
-
if (Array.isArray(app2)) {
|
|
57192
|
-
return pTryEach(app2, (appName) => baseOpen({
|
|
57193
|
-
...options,
|
|
57194
|
-
app: {
|
|
57195
|
-
name: appName,
|
|
57196
|
-
arguments: appArguments
|
|
57197
|
-
}
|
|
57198
|
-
}));
|
|
57199
|
-
}
|
|
57200
|
-
if (app2 === "browser" || app2 === "browserPrivate") {
|
|
57201
|
-
const ids = {
|
|
57202
|
-
"com.google.chrome": "chrome",
|
|
57203
|
-
"google-chrome.desktop": "chrome",
|
|
57204
|
-
"org.mozilla.firefox": "firefox",
|
|
57205
|
-
"firefox.desktop": "firefox",
|
|
57206
|
-
"com.microsoft.msedge": "edge",
|
|
57207
|
-
"com.microsoft.edge": "edge",
|
|
57208
|
-
"microsoft-edge.desktop": "edge"
|
|
57209
|
-
};
|
|
57210
|
-
const flags = {
|
|
57211
|
-
chrome: "--incognito",
|
|
57212
|
-
firefox: "--private-window",
|
|
57213
|
-
edge: "--inPrivate"
|
|
57214
|
-
};
|
|
57215
|
-
const browser = await defaultBrowser2();
|
|
57216
|
-
if (browser.id in ids) {
|
|
57217
|
-
const browserName = ids[browser.id];
|
|
57218
|
-
if (app2 === "browserPrivate") {
|
|
57219
|
-
appArguments.push(flags[browserName]);
|
|
57220
|
-
}
|
|
57221
|
-
return baseOpen({
|
|
57222
|
-
...options,
|
|
57223
|
-
app: {
|
|
57224
|
-
name: apps[browserName],
|
|
57225
|
-
arguments: appArguments
|
|
57226
|
-
}
|
|
57227
|
-
});
|
|
57228
|
-
}
|
|
57229
|
-
throw new Error(`${browser.name} is not supported as a default browser`);
|
|
57230
|
-
}
|
|
57231
|
-
let command;
|
|
57232
|
-
const cliArguments = [];
|
|
57233
|
-
const childProcessOptions = {};
|
|
57234
|
-
if (platform === "darwin") {
|
|
57235
|
-
command = "open";
|
|
57236
|
-
if (options.wait) {
|
|
57237
|
-
cliArguments.push("--wait-apps");
|
|
57238
|
-
}
|
|
57239
|
-
if (options.background) {
|
|
57240
|
-
cliArguments.push("--background");
|
|
57241
|
-
}
|
|
57242
|
-
if (options.newInstance) {
|
|
57243
|
-
cliArguments.push("--new");
|
|
57244
|
-
}
|
|
57245
|
-
if (app2) {
|
|
57246
|
-
cliArguments.push("-a", app2);
|
|
57247
|
-
}
|
|
57248
|
-
} else if (platform === "win32" || is_wsl_default && !isInsideContainer() && !app2) {
|
|
57249
|
-
const mountPoint = await getWslDrivesMountPoint();
|
|
57250
|
-
command = is_wsl_default ? `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` : `${import_node_process7.default.env.SYSTEMROOT || import_node_process7.default.env.windir || "C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`;
|
|
57251
|
-
cliArguments.push(
|
|
57252
|
-
"-NoProfile",
|
|
57253
|
-
"-NonInteractive",
|
|
57254
|
-
"-ExecutionPolicy",
|
|
57255
|
-
"Bypass",
|
|
57256
|
-
"-EncodedCommand"
|
|
57257
|
-
);
|
|
57258
|
-
if (!is_wsl_default) {
|
|
57259
|
-
childProcessOptions.windowsVerbatimArguments = true;
|
|
57260
|
-
}
|
|
57261
|
-
const encodedArguments = ["Start"];
|
|
57262
|
-
if (options.wait) {
|
|
57263
|
-
encodedArguments.push("-Wait");
|
|
57264
|
-
}
|
|
57265
|
-
if (app2) {
|
|
57266
|
-
encodedArguments.push(`"\`"${app2}\`""`);
|
|
57267
|
-
if (options.target) {
|
|
57268
|
-
appArguments.push(options.target);
|
|
57269
|
-
}
|
|
57270
|
-
} else if (options.target) {
|
|
57271
|
-
encodedArguments.push(`"${options.target}"`);
|
|
57272
|
-
}
|
|
57273
|
-
if (appArguments.length > 0) {
|
|
57274
|
-
appArguments = appArguments.map((argument) => `"\`"${argument}\`""`);
|
|
57275
|
-
encodedArguments.push("-ArgumentList", appArguments.join(","));
|
|
57276
|
-
}
|
|
57277
|
-
options.target = import_node_buffer.Buffer.from(encodedArguments.join(" "), "utf16le").toString("base64");
|
|
57278
|
-
} else {
|
|
57279
|
-
if (app2) {
|
|
57280
|
-
command = app2;
|
|
57281
|
-
} else {
|
|
57282
|
-
const isBundled = !__dirname2 || __dirname2 === "/";
|
|
57283
|
-
let exeLocalXdgOpen = false;
|
|
57284
|
-
try {
|
|
57285
|
-
await import_promises.default.access(localXdgOpenPath, import_promises.constants.X_OK);
|
|
57286
|
-
exeLocalXdgOpen = true;
|
|
57287
|
-
} catch {
|
|
57288
|
-
}
|
|
57289
|
-
const useSystemXdgOpen = import_node_process7.default.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
|
|
57290
|
-
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
57291
|
-
}
|
|
57292
|
-
if (appArguments.length > 0) {
|
|
57293
|
-
cliArguments.push(...appArguments);
|
|
57294
|
-
}
|
|
57295
|
-
if (!options.wait) {
|
|
57296
|
-
childProcessOptions.stdio = "ignore";
|
|
57297
|
-
childProcessOptions.detached = true;
|
|
57298
|
-
}
|
|
57299
|
-
}
|
|
57300
|
-
if (platform === "darwin" && appArguments.length > 0) {
|
|
57301
|
-
cliArguments.push("--args", ...appArguments);
|
|
57302
|
-
}
|
|
57303
|
-
if (options.target) {
|
|
57304
|
-
cliArguments.push(options.target);
|
|
57305
|
-
}
|
|
57306
|
-
const subprocess = import_node_child_process5.default.spawn(command, cliArguments, childProcessOptions);
|
|
57307
|
-
if (options.wait) {
|
|
57308
|
-
return new Promise((resolve2, reject) => {
|
|
57309
|
-
subprocess.once("error", reject);
|
|
57310
|
-
subprocess.once("close", (exitCode) => {
|
|
57311
|
-
if (!options.allowNonzeroExitCode && exitCode > 0) {
|
|
57312
|
-
reject(new Error(`Exited with code ${exitCode}`));
|
|
57313
|
-
return;
|
|
57314
|
-
}
|
|
57315
|
-
resolve2(subprocess);
|
|
57316
|
-
});
|
|
57317
|
-
});
|
|
57318
|
-
}
|
|
57319
|
-
subprocess.unref();
|
|
57320
|
-
return subprocess;
|
|
57321
|
-
};
|
|
57322
|
-
open = (target, options) => {
|
|
57323
|
-
if (typeof target !== "string") {
|
|
57324
|
-
throw new TypeError("Expected a `target`");
|
|
57325
|
-
}
|
|
57326
|
-
return baseOpen({
|
|
57327
|
-
...options,
|
|
57328
|
-
target
|
|
57329
|
-
});
|
|
57330
|
-
};
|
|
57331
|
-
openApp = (name, options) => {
|
|
57332
|
-
if (typeof name !== "string" && !Array.isArray(name)) {
|
|
57333
|
-
throw new TypeError("Expected a valid `name`");
|
|
57334
|
-
}
|
|
57335
|
-
const { arguments: appArguments = [] } = options ?? {};
|
|
57336
|
-
if (appArguments !== void 0 && appArguments !== null && !Array.isArray(appArguments)) {
|
|
57337
|
-
throw new TypeError("Expected `appArguments` as Array type");
|
|
57338
|
-
}
|
|
57339
|
-
return baseOpen({
|
|
57340
|
-
...options,
|
|
57341
|
-
app: {
|
|
57342
|
-
name,
|
|
57343
|
-
arguments: appArguments
|
|
57344
|
-
}
|
|
57345
|
-
});
|
|
57346
|
-
};
|
|
57347
|
-
apps = {};
|
|
57348
|
-
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
57349
|
-
darwin: "google chrome",
|
|
57350
|
-
win32: "chrome",
|
|
57351
|
-
linux: ["google-chrome", "google-chrome-stable", "chromium"]
|
|
57352
|
-
}, {
|
|
57353
|
-
wsl: {
|
|
57354
|
-
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
57355
|
-
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
57356
|
-
}
|
|
57357
|
-
}));
|
|
57358
|
-
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
|
57359
|
-
darwin: "firefox",
|
|
57360
|
-
win32: "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
|
|
57361
|
-
linux: "firefox"
|
|
57362
|
-
}, {
|
|
57363
|
-
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
|
|
57364
|
-
}));
|
|
57365
|
-
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
57366
|
-
darwin: "microsoft edge",
|
|
57367
|
-
win32: "msedge",
|
|
57368
|
-
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
57369
|
-
}, {
|
|
57370
|
-
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
57371
|
-
}));
|
|
57372
|
-
defineLazyProperty(apps, "browser", () => "browser");
|
|
57373
|
-
defineLazyProperty(apps, "browserPrivate", () => "browserPrivate");
|
|
57374
|
-
open_default = open;
|
|
57375
|
-
}
|
|
57376
|
-
});
|
|
57377
|
-
|
|
57378
56868
|
// node_modules/adm-zip/util/fileSystem.js
|
|
57379
56869
|
var require_fileSystem = __commonJS({
|
|
57380
56870
|
"node_modules/adm-zip/util/fileSystem.js"(exports2) {
|
|
@@ -59727,6 +59217,516 @@ var require_adm_zip = __commonJS({
|
|
|
59727
59217
|
}
|
|
59728
59218
|
});
|
|
59729
59219
|
|
|
59220
|
+
// node_modules/is-inside-container/node_modules/is-docker/index.js
|
|
59221
|
+
function hasDockerEnv() {
|
|
59222
|
+
try {
|
|
59223
|
+
import_node_fs.default.statSync("/.dockerenv");
|
|
59224
|
+
return true;
|
|
59225
|
+
} catch {
|
|
59226
|
+
return false;
|
|
59227
|
+
}
|
|
59228
|
+
}
|
|
59229
|
+
function hasDockerCGroup() {
|
|
59230
|
+
try {
|
|
59231
|
+
return import_node_fs.default.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
59232
|
+
} catch {
|
|
59233
|
+
return false;
|
|
59234
|
+
}
|
|
59235
|
+
}
|
|
59236
|
+
function isDocker() {
|
|
59237
|
+
if (isDockerCached === void 0) {
|
|
59238
|
+
isDockerCached = hasDockerEnv() || hasDockerCGroup();
|
|
59239
|
+
}
|
|
59240
|
+
return isDockerCached;
|
|
59241
|
+
}
|
|
59242
|
+
var import_node_fs, isDockerCached;
|
|
59243
|
+
var init_is_docker = __esm({
|
|
59244
|
+
"node_modules/is-inside-container/node_modules/is-docker/index.js"() {
|
|
59245
|
+
import_node_fs = __toESM(require("node:fs"), 1);
|
|
59246
|
+
}
|
|
59247
|
+
});
|
|
59248
|
+
|
|
59249
|
+
// node_modules/is-inside-container/index.js
|
|
59250
|
+
function isInsideContainer() {
|
|
59251
|
+
if (cachedResult === void 0) {
|
|
59252
|
+
cachedResult = hasContainerEnv() || isDocker();
|
|
59253
|
+
}
|
|
59254
|
+
return cachedResult;
|
|
59255
|
+
}
|
|
59256
|
+
var import_node_fs2, cachedResult, hasContainerEnv;
|
|
59257
|
+
var init_is_inside_container = __esm({
|
|
59258
|
+
"node_modules/is-inside-container/index.js"() {
|
|
59259
|
+
import_node_fs2 = __toESM(require("node:fs"), 1);
|
|
59260
|
+
init_is_docker();
|
|
59261
|
+
hasContainerEnv = () => {
|
|
59262
|
+
try {
|
|
59263
|
+
import_node_fs2.default.statSync("/run/.containerenv");
|
|
59264
|
+
return true;
|
|
59265
|
+
} catch {
|
|
59266
|
+
return false;
|
|
59267
|
+
}
|
|
59268
|
+
};
|
|
59269
|
+
}
|
|
59270
|
+
});
|
|
59271
|
+
|
|
59272
|
+
// node_modules/is-wsl/index.js
|
|
59273
|
+
var import_node_process3, import_node_os, import_node_fs3, isWsl, is_wsl_default;
|
|
59274
|
+
var init_is_wsl = __esm({
|
|
59275
|
+
"node_modules/is-wsl/index.js"() {
|
|
59276
|
+
import_node_process3 = __toESM(require("node:process"), 1);
|
|
59277
|
+
import_node_os = __toESM(require("node:os"), 1);
|
|
59278
|
+
import_node_fs3 = __toESM(require("node:fs"), 1);
|
|
59279
|
+
init_is_inside_container();
|
|
59280
|
+
isWsl = () => {
|
|
59281
|
+
if (import_node_process3.default.platform !== "linux") {
|
|
59282
|
+
return false;
|
|
59283
|
+
}
|
|
59284
|
+
if (import_node_os.default.release().toLowerCase().includes("microsoft")) {
|
|
59285
|
+
if (isInsideContainer()) {
|
|
59286
|
+
return false;
|
|
59287
|
+
}
|
|
59288
|
+
return true;
|
|
59289
|
+
}
|
|
59290
|
+
try {
|
|
59291
|
+
return import_node_fs3.default.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
|
|
59292
|
+
} catch {
|
|
59293
|
+
return false;
|
|
59294
|
+
}
|
|
59295
|
+
};
|
|
59296
|
+
is_wsl_default = import_node_process3.default.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
59297
|
+
}
|
|
59298
|
+
});
|
|
59299
|
+
|
|
59300
|
+
// node_modules/define-lazy-prop/index.js
|
|
59301
|
+
function defineLazyProperty(object, propertyName, valueGetter) {
|
|
59302
|
+
const define2 = (value) => Object.defineProperty(object, propertyName, { value, enumerable: true, writable: true });
|
|
59303
|
+
Object.defineProperty(object, propertyName, {
|
|
59304
|
+
configurable: true,
|
|
59305
|
+
enumerable: true,
|
|
59306
|
+
get() {
|
|
59307
|
+
const result = valueGetter();
|
|
59308
|
+
define2(result);
|
|
59309
|
+
return result;
|
|
59310
|
+
},
|
|
59311
|
+
set(value) {
|
|
59312
|
+
define2(value);
|
|
59313
|
+
}
|
|
59314
|
+
});
|
|
59315
|
+
return object;
|
|
59316
|
+
}
|
|
59317
|
+
var init_define_lazy_prop = __esm({
|
|
59318
|
+
"node_modules/define-lazy-prop/index.js"() {
|
|
59319
|
+
}
|
|
59320
|
+
});
|
|
59321
|
+
|
|
59322
|
+
// node_modules/default-browser-id/index.js
|
|
59323
|
+
async function defaultBrowserId() {
|
|
59324
|
+
if (import_node_process4.default.platform !== "darwin") {
|
|
59325
|
+
throw new Error("macOS only");
|
|
59326
|
+
}
|
|
59327
|
+
const { stdout } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
|
|
59328
|
+
const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
|
|
59329
|
+
return match?.groups.id ?? "com.apple.Safari";
|
|
59330
|
+
}
|
|
59331
|
+
var import_node_util, import_node_process4, import_node_child_process, execFileAsync;
|
|
59332
|
+
var init_default_browser_id = __esm({
|
|
59333
|
+
"node_modules/default-browser-id/index.js"() {
|
|
59334
|
+
import_node_util = require("node:util");
|
|
59335
|
+
import_node_process4 = __toESM(require("node:process"), 1);
|
|
59336
|
+
import_node_child_process = require("node:child_process");
|
|
59337
|
+
execFileAsync = (0, import_node_util.promisify)(import_node_child_process.execFile);
|
|
59338
|
+
}
|
|
59339
|
+
});
|
|
59340
|
+
|
|
59341
|
+
// node_modules/run-applescript/index.js
|
|
59342
|
+
async function runAppleScript(script, { humanReadableOutput = true } = {}) {
|
|
59343
|
+
if (import_node_process5.default.platform !== "darwin") {
|
|
59344
|
+
throw new Error("macOS only");
|
|
59345
|
+
}
|
|
59346
|
+
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
59347
|
+
const { stdout } = await execFileAsync2("osascript", ["-e", script, outputArguments]);
|
|
59348
|
+
return stdout.trim();
|
|
59349
|
+
}
|
|
59350
|
+
var import_node_process5, import_node_util2, import_node_child_process2, execFileAsync2;
|
|
59351
|
+
var init_run_applescript = __esm({
|
|
59352
|
+
"node_modules/run-applescript/index.js"() {
|
|
59353
|
+
import_node_process5 = __toESM(require("node:process"), 1);
|
|
59354
|
+
import_node_util2 = require("node:util");
|
|
59355
|
+
import_node_child_process2 = require("node:child_process");
|
|
59356
|
+
execFileAsync2 = (0, import_node_util2.promisify)(import_node_child_process2.execFile);
|
|
59357
|
+
}
|
|
59358
|
+
});
|
|
59359
|
+
|
|
59360
|
+
// node_modules/bundle-name/index.js
|
|
59361
|
+
async function bundleName(bundleId) {
|
|
59362
|
+
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string
|
|
59363
|
+
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
59364
|
+
}
|
|
59365
|
+
var init_bundle_name = __esm({
|
|
59366
|
+
"node_modules/bundle-name/index.js"() {
|
|
59367
|
+
init_run_applescript();
|
|
59368
|
+
}
|
|
59369
|
+
});
|
|
59370
|
+
|
|
59371
|
+
// node_modules/default-browser/windows.js
|
|
59372
|
+
async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
59373
|
+
const { stdout } = await _execFileAsync("reg", [
|
|
59374
|
+
"QUERY",
|
|
59375
|
+
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
59376
|
+
"/v",
|
|
59377
|
+
"ProgId"
|
|
59378
|
+
]);
|
|
59379
|
+
const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
|
|
59380
|
+
if (!match) {
|
|
59381
|
+
throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
|
|
59382
|
+
}
|
|
59383
|
+
const { id } = match.groups;
|
|
59384
|
+
const browser = windowsBrowserProgIds[id];
|
|
59385
|
+
if (!browser) {
|
|
59386
|
+
throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
|
|
59387
|
+
}
|
|
59388
|
+
return browser;
|
|
59389
|
+
}
|
|
59390
|
+
var import_node_util3, import_node_child_process3, execFileAsync3, windowsBrowserProgIds, UnknownBrowserError;
|
|
59391
|
+
var init_windows = __esm({
|
|
59392
|
+
"node_modules/default-browser/windows.js"() {
|
|
59393
|
+
import_node_util3 = require("node:util");
|
|
59394
|
+
import_node_child_process3 = require("node:child_process");
|
|
59395
|
+
execFileAsync3 = (0, import_node_util3.promisify)(import_node_child_process3.execFile);
|
|
59396
|
+
windowsBrowserProgIds = {
|
|
59397
|
+
AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
|
|
59398
|
+
MSEdgeDHTML: { name: "Edge", id: "com.microsoft.edge" },
|
|
59399
|
+
// On macOS, it's "com.microsoft.edgemac"
|
|
59400
|
+
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
|
|
59401
|
+
// Newer Edge/Win10 releases
|
|
59402
|
+
"IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" },
|
|
59403
|
+
FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
|
|
59404
|
+
ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
|
|
59405
|
+
BraveHTML: { name: "Brave", id: "com.brave.Browser" },
|
|
59406
|
+
BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
|
|
59407
|
+
BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" }
|
|
59408
|
+
};
|
|
59409
|
+
UnknownBrowserError = class extends Error {
|
|
59410
|
+
};
|
|
59411
|
+
}
|
|
59412
|
+
});
|
|
59413
|
+
|
|
59414
|
+
// node_modules/default-browser/index.js
|
|
59415
|
+
async function defaultBrowser2() {
|
|
59416
|
+
if (import_node_process6.default.platform === "darwin") {
|
|
59417
|
+
const id = await defaultBrowserId();
|
|
59418
|
+
const name = await bundleName(id);
|
|
59419
|
+
return { name, id };
|
|
59420
|
+
}
|
|
59421
|
+
if (import_node_process6.default.platform === "linux") {
|
|
59422
|
+
const { stdout } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
|
|
59423
|
+
const id = stdout.trim();
|
|
59424
|
+
const name = titleize(id.replace(/.desktop$/, "").replace("-", " "));
|
|
59425
|
+
return { name, id };
|
|
59426
|
+
}
|
|
59427
|
+
if (import_node_process6.default.platform === "win32") {
|
|
59428
|
+
return defaultBrowser();
|
|
59429
|
+
}
|
|
59430
|
+
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
59431
|
+
}
|
|
59432
|
+
var import_node_util4, import_node_process6, import_node_child_process4, execFileAsync4, titleize;
|
|
59433
|
+
var init_default_browser = __esm({
|
|
59434
|
+
"node_modules/default-browser/index.js"() {
|
|
59435
|
+
import_node_util4 = require("node:util");
|
|
59436
|
+
import_node_process6 = __toESM(require("node:process"), 1);
|
|
59437
|
+
import_node_child_process4 = require("node:child_process");
|
|
59438
|
+
init_default_browser_id();
|
|
59439
|
+
init_bundle_name();
|
|
59440
|
+
init_windows();
|
|
59441
|
+
execFileAsync4 = (0, import_node_util4.promisify)(import_node_child_process4.execFile);
|
|
59442
|
+
titleize = (string) => string.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x3) => x3.toUpperCase());
|
|
59443
|
+
}
|
|
59444
|
+
});
|
|
59445
|
+
|
|
59446
|
+
// node_modules/open/index.js
|
|
59447
|
+
var open_exports = {};
|
|
59448
|
+
__export(open_exports, {
|
|
59449
|
+
apps: () => apps,
|
|
59450
|
+
default: () => open_default,
|
|
59451
|
+
openApp: () => openApp
|
|
59452
|
+
});
|
|
59453
|
+
function detectArchBinary(binary) {
|
|
59454
|
+
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
59455
|
+
return binary;
|
|
59456
|
+
}
|
|
59457
|
+
const { [arch]: archBinary } = binary;
|
|
59458
|
+
if (!archBinary) {
|
|
59459
|
+
throw new Error(`${arch} is not supported`);
|
|
59460
|
+
}
|
|
59461
|
+
return archBinary;
|
|
59462
|
+
}
|
|
59463
|
+
function detectPlatformBinary({ [platform]: platformBinary }, { wsl }) {
|
|
59464
|
+
if (wsl && is_wsl_default) {
|
|
59465
|
+
return detectArchBinary(wsl);
|
|
59466
|
+
}
|
|
59467
|
+
if (!platformBinary) {
|
|
59468
|
+
throw new Error(`${platform} is not supported`);
|
|
59469
|
+
}
|
|
59470
|
+
return detectArchBinary(platformBinary);
|
|
59471
|
+
}
|
|
59472
|
+
var import_node_process7, import_node_buffer, import_node_path, import_node_url, import_node_child_process5, import_promises, import_meta, __dirname2, localXdgOpenPath, platform, arch, getWslDrivesMountPoint, pTryEach, baseOpen, open, openApp, apps, open_default;
|
|
59473
|
+
var init_open = __esm({
|
|
59474
|
+
"node_modules/open/index.js"() {
|
|
59475
|
+
import_node_process7 = __toESM(require("node:process"), 1);
|
|
59476
|
+
import_node_buffer = require("node:buffer");
|
|
59477
|
+
import_node_path = __toESM(require("node:path"), 1);
|
|
59478
|
+
import_node_url = require("node:url");
|
|
59479
|
+
import_node_child_process5 = __toESM(require("node:child_process"), 1);
|
|
59480
|
+
import_promises = __toESM(require("node:fs/promises"), 1);
|
|
59481
|
+
init_is_wsl();
|
|
59482
|
+
init_define_lazy_prop();
|
|
59483
|
+
init_default_browser();
|
|
59484
|
+
init_is_inside_container();
|
|
59485
|
+
import_meta = {};
|
|
59486
|
+
__dirname2 = import_node_path.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
59487
|
+
localXdgOpenPath = import_node_path.default.join(__dirname2, "xdg-open");
|
|
59488
|
+
({ platform, arch } = import_node_process7.default);
|
|
59489
|
+
getWslDrivesMountPoint = /* @__PURE__ */ (() => {
|
|
59490
|
+
const defaultMountPoint = "/mnt/";
|
|
59491
|
+
let mountPoint;
|
|
59492
|
+
return async function() {
|
|
59493
|
+
if (mountPoint) {
|
|
59494
|
+
return mountPoint;
|
|
59495
|
+
}
|
|
59496
|
+
const configFilePath = "/etc/wsl.conf";
|
|
59497
|
+
let isConfigFileExists = false;
|
|
59498
|
+
try {
|
|
59499
|
+
await import_promises.default.access(configFilePath, import_promises.constants.F_OK);
|
|
59500
|
+
isConfigFileExists = true;
|
|
59501
|
+
} catch {
|
|
59502
|
+
}
|
|
59503
|
+
if (!isConfigFileExists) {
|
|
59504
|
+
return defaultMountPoint;
|
|
59505
|
+
}
|
|
59506
|
+
const configContent = await import_promises.default.readFile(configFilePath, { encoding: "utf8" });
|
|
59507
|
+
const configMountPoint = /(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(configContent);
|
|
59508
|
+
if (!configMountPoint) {
|
|
59509
|
+
return defaultMountPoint;
|
|
59510
|
+
}
|
|
59511
|
+
mountPoint = configMountPoint.groups.mountPoint.trim();
|
|
59512
|
+
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
59513
|
+
return mountPoint;
|
|
59514
|
+
};
|
|
59515
|
+
})();
|
|
59516
|
+
pTryEach = async (array, mapper) => {
|
|
59517
|
+
let latestError;
|
|
59518
|
+
for (const item of array) {
|
|
59519
|
+
try {
|
|
59520
|
+
return await mapper(item);
|
|
59521
|
+
} catch (error) {
|
|
59522
|
+
latestError = error;
|
|
59523
|
+
}
|
|
59524
|
+
}
|
|
59525
|
+
throw latestError;
|
|
59526
|
+
};
|
|
59527
|
+
baseOpen = async (options) => {
|
|
59528
|
+
options = {
|
|
59529
|
+
wait: false,
|
|
59530
|
+
background: false,
|
|
59531
|
+
newInstance: false,
|
|
59532
|
+
allowNonzeroExitCode: false,
|
|
59533
|
+
...options
|
|
59534
|
+
};
|
|
59535
|
+
if (Array.isArray(options.app)) {
|
|
59536
|
+
return pTryEach(options.app, (singleApp) => baseOpen({
|
|
59537
|
+
...options,
|
|
59538
|
+
app: singleApp
|
|
59539
|
+
}));
|
|
59540
|
+
}
|
|
59541
|
+
let { name: app2, arguments: appArguments = [] } = options.app ?? {};
|
|
59542
|
+
appArguments = [...appArguments];
|
|
59543
|
+
if (Array.isArray(app2)) {
|
|
59544
|
+
return pTryEach(app2, (appName) => baseOpen({
|
|
59545
|
+
...options,
|
|
59546
|
+
app: {
|
|
59547
|
+
name: appName,
|
|
59548
|
+
arguments: appArguments
|
|
59549
|
+
}
|
|
59550
|
+
}));
|
|
59551
|
+
}
|
|
59552
|
+
if (app2 === "browser" || app2 === "browserPrivate") {
|
|
59553
|
+
const ids = {
|
|
59554
|
+
"com.google.chrome": "chrome",
|
|
59555
|
+
"google-chrome.desktop": "chrome",
|
|
59556
|
+
"org.mozilla.firefox": "firefox",
|
|
59557
|
+
"firefox.desktop": "firefox",
|
|
59558
|
+
"com.microsoft.msedge": "edge",
|
|
59559
|
+
"com.microsoft.edge": "edge",
|
|
59560
|
+
"microsoft-edge.desktop": "edge"
|
|
59561
|
+
};
|
|
59562
|
+
const flags = {
|
|
59563
|
+
chrome: "--incognito",
|
|
59564
|
+
firefox: "--private-window",
|
|
59565
|
+
edge: "--inPrivate"
|
|
59566
|
+
};
|
|
59567
|
+
const browser = await defaultBrowser2();
|
|
59568
|
+
if (browser.id in ids) {
|
|
59569
|
+
const browserName = ids[browser.id];
|
|
59570
|
+
if (app2 === "browserPrivate") {
|
|
59571
|
+
appArguments.push(flags[browserName]);
|
|
59572
|
+
}
|
|
59573
|
+
return baseOpen({
|
|
59574
|
+
...options,
|
|
59575
|
+
app: {
|
|
59576
|
+
name: apps[browserName],
|
|
59577
|
+
arguments: appArguments
|
|
59578
|
+
}
|
|
59579
|
+
});
|
|
59580
|
+
}
|
|
59581
|
+
throw new Error(`${browser.name} is not supported as a default browser`);
|
|
59582
|
+
}
|
|
59583
|
+
let command;
|
|
59584
|
+
const cliArguments = [];
|
|
59585
|
+
const childProcessOptions = {};
|
|
59586
|
+
if (platform === "darwin") {
|
|
59587
|
+
command = "open";
|
|
59588
|
+
if (options.wait) {
|
|
59589
|
+
cliArguments.push("--wait-apps");
|
|
59590
|
+
}
|
|
59591
|
+
if (options.background) {
|
|
59592
|
+
cliArguments.push("--background");
|
|
59593
|
+
}
|
|
59594
|
+
if (options.newInstance) {
|
|
59595
|
+
cliArguments.push("--new");
|
|
59596
|
+
}
|
|
59597
|
+
if (app2) {
|
|
59598
|
+
cliArguments.push("-a", app2);
|
|
59599
|
+
}
|
|
59600
|
+
} else if (platform === "win32" || is_wsl_default && !isInsideContainer() && !app2) {
|
|
59601
|
+
const mountPoint = await getWslDrivesMountPoint();
|
|
59602
|
+
command = is_wsl_default ? `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` : `${import_node_process7.default.env.SYSTEMROOT || import_node_process7.default.env.windir || "C:\\Windows"}\\System32\\WindowsPowerShell\\v1.0\\powershell`;
|
|
59603
|
+
cliArguments.push(
|
|
59604
|
+
"-NoProfile",
|
|
59605
|
+
"-NonInteractive",
|
|
59606
|
+
"-ExecutionPolicy",
|
|
59607
|
+
"Bypass",
|
|
59608
|
+
"-EncodedCommand"
|
|
59609
|
+
);
|
|
59610
|
+
if (!is_wsl_default) {
|
|
59611
|
+
childProcessOptions.windowsVerbatimArguments = true;
|
|
59612
|
+
}
|
|
59613
|
+
const encodedArguments = ["Start"];
|
|
59614
|
+
if (options.wait) {
|
|
59615
|
+
encodedArguments.push("-Wait");
|
|
59616
|
+
}
|
|
59617
|
+
if (app2) {
|
|
59618
|
+
encodedArguments.push(`"\`"${app2}\`""`);
|
|
59619
|
+
if (options.target) {
|
|
59620
|
+
appArguments.push(options.target);
|
|
59621
|
+
}
|
|
59622
|
+
} else if (options.target) {
|
|
59623
|
+
encodedArguments.push(`"${options.target}"`);
|
|
59624
|
+
}
|
|
59625
|
+
if (appArguments.length > 0) {
|
|
59626
|
+
appArguments = appArguments.map((argument) => `"\`"${argument}\`""`);
|
|
59627
|
+
encodedArguments.push("-ArgumentList", appArguments.join(","));
|
|
59628
|
+
}
|
|
59629
|
+
options.target = import_node_buffer.Buffer.from(encodedArguments.join(" "), "utf16le").toString("base64");
|
|
59630
|
+
} else {
|
|
59631
|
+
if (app2) {
|
|
59632
|
+
command = app2;
|
|
59633
|
+
} else {
|
|
59634
|
+
const isBundled = !__dirname2 || __dirname2 === "/";
|
|
59635
|
+
let exeLocalXdgOpen = false;
|
|
59636
|
+
try {
|
|
59637
|
+
await import_promises.default.access(localXdgOpenPath, import_promises.constants.X_OK);
|
|
59638
|
+
exeLocalXdgOpen = true;
|
|
59639
|
+
} catch {
|
|
59640
|
+
}
|
|
59641
|
+
const useSystemXdgOpen = import_node_process7.default.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
|
|
59642
|
+
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
59643
|
+
}
|
|
59644
|
+
if (appArguments.length > 0) {
|
|
59645
|
+
cliArguments.push(...appArguments);
|
|
59646
|
+
}
|
|
59647
|
+
if (!options.wait) {
|
|
59648
|
+
childProcessOptions.stdio = "ignore";
|
|
59649
|
+
childProcessOptions.detached = true;
|
|
59650
|
+
}
|
|
59651
|
+
}
|
|
59652
|
+
if (platform === "darwin" && appArguments.length > 0) {
|
|
59653
|
+
cliArguments.push("--args", ...appArguments);
|
|
59654
|
+
}
|
|
59655
|
+
if (options.target) {
|
|
59656
|
+
cliArguments.push(options.target);
|
|
59657
|
+
}
|
|
59658
|
+
const subprocess = import_node_child_process5.default.spawn(command, cliArguments, childProcessOptions);
|
|
59659
|
+
if (options.wait) {
|
|
59660
|
+
return new Promise((resolve2, reject) => {
|
|
59661
|
+
subprocess.once("error", reject);
|
|
59662
|
+
subprocess.once("close", (exitCode) => {
|
|
59663
|
+
if (!options.allowNonzeroExitCode && exitCode > 0) {
|
|
59664
|
+
reject(new Error(`Exited with code ${exitCode}`));
|
|
59665
|
+
return;
|
|
59666
|
+
}
|
|
59667
|
+
resolve2(subprocess);
|
|
59668
|
+
});
|
|
59669
|
+
});
|
|
59670
|
+
}
|
|
59671
|
+
subprocess.unref();
|
|
59672
|
+
return subprocess;
|
|
59673
|
+
};
|
|
59674
|
+
open = (target, options) => {
|
|
59675
|
+
if (typeof target !== "string") {
|
|
59676
|
+
throw new TypeError("Expected a `target`");
|
|
59677
|
+
}
|
|
59678
|
+
return baseOpen({
|
|
59679
|
+
...options,
|
|
59680
|
+
target
|
|
59681
|
+
});
|
|
59682
|
+
};
|
|
59683
|
+
openApp = (name, options) => {
|
|
59684
|
+
if (typeof name !== "string" && !Array.isArray(name)) {
|
|
59685
|
+
throw new TypeError("Expected a valid `name`");
|
|
59686
|
+
}
|
|
59687
|
+
const { arguments: appArguments = [] } = options ?? {};
|
|
59688
|
+
if (appArguments !== void 0 && appArguments !== null && !Array.isArray(appArguments)) {
|
|
59689
|
+
throw new TypeError("Expected `appArguments` as Array type");
|
|
59690
|
+
}
|
|
59691
|
+
return baseOpen({
|
|
59692
|
+
...options,
|
|
59693
|
+
app: {
|
|
59694
|
+
name,
|
|
59695
|
+
arguments: appArguments
|
|
59696
|
+
}
|
|
59697
|
+
});
|
|
59698
|
+
};
|
|
59699
|
+
apps = {};
|
|
59700
|
+
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
59701
|
+
darwin: "google chrome",
|
|
59702
|
+
win32: "chrome",
|
|
59703
|
+
linux: ["google-chrome", "google-chrome-stable", "chromium"]
|
|
59704
|
+
}, {
|
|
59705
|
+
wsl: {
|
|
59706
|
+
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
59707
|
+
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
59708
|
+
}
|
|
59709
|
+
}));
|
|
59710
|
+
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
|
59711
|
+
darwin: "firefox",
|
|
59712
|
+
win32: "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
|
|
59713
|
+
linux: "firefox"
|
|
59714
|
+
}, {
|
|
59715
|
+
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
|
|
59716
|
+
}));
|
|
59717
|
+
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
59718
|
+
darwin: "microsoft edge",
|
|
59719
|
+
win32: "msedge",
|
|
59720
|
+
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
59721
|
+
}, {
|
|
59722
|
+
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
59723
|
+
}));
|
|
59724
|
+
defineLazyProperty(apps, "browser", () => "browser");
|
|
59725
|
+
defineLazyProperty(apps, "browserPrivate", () => "browserPrivate");
|
|
59726
|
+
open_default = open;
|
|
59727
|
+
}
|
|
59728
|
+
});
|
|
59729
|
+
|
|
59730
59730
|
// node_modules/readable-stream/lib/internal/streams/stream.js
|
|
59731
59731
|
var require_stream6 = __commonJS({
|
|
59732
59732
|
"node_modules/readable-stream/lib/internal/streams/stream.js"(exports2, module2) {
|
|
@@ -71405,9 +71405,9 @@ var require_conf = __commonJS({
|
|
|
71405
71405
|
var require_defaults = __commonJS({
|
|
71406
71406
|
"node_modules/@pnpm/npm-conf/lib/defaults.js"(exports2) {
|
|
71407
71407
|
"use strict";
|
|
71408
|
-
var
|
|
71408
|
+
var os4 = require("os");
|
|
71409
71409
|
var path3 = require("path");
|
|
71410
|
-
var temp =
|
|
71410
|
+
var temp = os4.tmpdir();
|
|
71411
71411
|
var uidOrPid = process.getuid ? process.getuid() : process.pid;
|
|
71412
71412
|
var hasUnicode = () => true;
|
|
71413
71413
|
var isWindows = process.platform === "win32";
|
|
@@ -71418,7 +71418,7 @@ var require_defaults = __commonJS({
|
|
|
71418
71418
|
var umask = {
|
|
71419
71419
|
fromString: () => process.umask()
|
|
71420
71420
|
};
|
|
71421
|
-
var home =
|
|
71421
|
+
var home = os4.homedir();
|
|
71422
71422
|
if (home) {
|
|
71423
71423
|
process.env.HOME = home;
|
|
71424
71424
|
} else {
|
|
@@ -108742,6 +108742,99 @@ var {
|
|
|
108742
108742
|
Help
|
|
108743
108743
|
} = import_index.default;
|
|
108744
108744
|
|
|
108745
|
+
// package.json
|
|
108746
|
+
var package_default = {
|
|
108747
|
+
name: "@capgo/cli",
|
|
108748
|
+
version: "4.10.23",
|
|
108749
|
+
description: "A CLI to upload to capgo servers",
|
|
108750
|
+
author: "github.com/riderx",
|
|
108751
|
+
license: "Apache 2.0",
|
|
108752
|
+
homepage: "https://github.com/Cap-go/CLIl#readme",
|
|
108753
|
+
repository: {
|
|
108754
|
+
type: "git",
|
|
108755
|
+
url: "git+https://github.com/Cap-go/CLI.git"
|
|
108756
|
+
},
|
|
108757
|
+
bugs: {
|
|
108758
|
+
url: "https://github.com/Cap-go/CLI/issues"
|
|
108759
|
+
},
|
|
108760
|
+
keywords: [
|
|
108761
|
+
"appflow alternative",
|
|
108762
|
+
"ionic",
|
|
108763
|
+
"capacitor",
|
|
108764
|
+
"auto update",
|
|
108765
|
+
"live update",
|
|
108766
|
+
"capgo",
|
|
108767
|
+
"cli",
|
|
108768
|
+
"upload",
|
|
108769
|
+
"capgo-cli"
|
|
108770
|
+
],
|
|
108771
|
+
main: "dist/index.js",
|
|
108772
|
+
bin: {
|
|
108773
|
+
capgo: "dist/index.js"
|
|
108774
|
+
},
|
|
108775
|
+
engines: {
|
|
108776
|
+
npm: ">=8.0.0",
|
|
108777
|
+
node: ">=18.0.0"
|
|
108778
|
+
},
|
|
108779
|
+
scripts: {
|
|
108780
|
+
build: "node build.mjs",
|
|
108781
|
+
dev: "NODE_ENV=development node build.mjs",
|
|
108782
|
+
"no-debug": "node dist/index.js",
|
|
108783
|
+
test: "npx --yes ts-node -T src/index.ts",
|
|
108784
|
+
"dev-build": "SUPA_DB=development node build.mjs",
|
|
108785
|
+
pack: "pkg",
|
|
108786
|
+
types: "npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",
|
|
108787
|
+
test_rls: "ts-node ./test/test_headers_rls.ts",
|
|
108788
|
+
lint: 'eslint "src/**/*.ts" --fix'
|
|
108789
|
+
},
|
|
108790
|
+
dependencies: {
|
|
108791
|
+
"@aws-sdk/client-s3": "^3.588.0",
|
|
108792
|
+
"@capacitor/cli": "6.0.0",
|
|
108793
|
+
"@capgo/find-package-manager": "^0.0.17",
|
|
108794
|
+
"@clack/prompts": "^0.7.0",
|
|
108795
|
+
"@manypkg/find-root": "^2.2.1",
|
|
108796
|
+
"@supabase/supabase-js": "^2.43.4",
|
|
108797
|
+
"@tomasklaen/checksum": "^1.1.0",
|
|
108798
|
+
"@trufflesuite/spinnies": "^0.1.1",
|
|
108799
|
+
"adm-zip": "^0.5.13",
|
|
108800
|
+
"ci-info": "^4.0.0",
|
|
108801
|
+
commander: "12.1.0",
|
|
108802
|
+
"console-table-printer": "^2.12.0",
|
|
108803
|
+
"get-latest-version": "^5.1.0",
|
|
108804
|
+
"is-wsl": "^3.1.0",
|
|
108805
|
+
ky: "^1.3.0",
|
|
108806
|
+
logsnag: "1.0.0",
|
|
108807
|
+
mime: "^4.0.3",
|
|
108808
|
+
"node-dir": "^0.1.17",
|
|
108809
|
+
open: "^10.1.0",
|
|
108810
|
+
prettyjson: "^1.2.5",
|
|
108811
|
+
"prompt-sync": "^4.2.0",
|
|
108812
|
+
semver: "^7.6.2"
|
|
108813
|
+
},
|
|
108814
|
+
devDependencies: {
|
|
108815
|
+
"@antfu/eslint-config": "^2.20.0",
|
|
108816
|
+
"@types/adm-zip": "0.5.5",
|
|
108817
|
+
"@types/mime": "^4.0.0",
|
|
108818
|
+
"@types/node": "^20.14.0",
|
|
108819
|
+
"@types/node-dir": "^0.0.37",
|
|
108820
|
+
"@types/npmcli__ci-detect": "^2.0.3",
|
|
108821
|
+
"@types/prettyjson": "^0.0.33",
|
|
108822
|
+
"@types/prompt-sync": "^4.2.3",
|
|
108823
|
+
"@types/semver": "^7.5.8",
|
|
108824
|
+
"@typescript-eslint/eslint-plugin": "^7.12.0",
|
|
108825
|
+
"@typescript-eslint/parser": "^7.12.0",
|
|
108826
|
+
esbuild: "^0.21.4",
|
|
108827
|
+
eslint: "9.4.0",
|
|
108828
|
+
"git-format-staged": "3.1.1",
|
|
108829
|
+
husky: "^9.0.11",
|
|
108830
|
+
pkg: "5.8.1",
|
|
108831
|
+
"ts-loader": "^9.5.1",
|
|
108832
|
+
"ts-node": "^10.9.2",
|
|
108833
|
+
"tsconfig-paths": "4.2.0",
|
|
108834
|
+
typescript: "5.4.5"
|
|
108835
|
+
}
|
|
108836
|
+
};
|
|
108837
|
+
|
|
108745
108838
|
// node_modules/@clack/core/dist/index.mjs
|
|
108746
108839
|
var import_sisteransi = __toESM(require_src(), 1);
|
|
108747
108840
|
var import_node_process = require("node:process");
|
|
@@ -109235,7 +109328,7 @@ var de = () => {
|
|
|
109235
109328
|
|
|
109236
109329
|
// src/utils.ts
|
|
109237
109330
|
var import_node_fs4 = require("node:fs");
|
|
109238
|
-
var import_node_os2 = require("node:os");
|
|
109331
|
+
var import_node_os2 = __toESM(require("node:os"));
|
|
109239
109332
|
var import_node_path2 = require("node:path");
|
|
109240
109333
|
var import_node_process8 = __toESM(require("node:process"));
|
|
109241
109334
|
var import_config = __toESM(require_config());
|
|
@@ -109834,6 +109927,8 @@ var findPackageManagerRunner = (path3 = ".", defaultPackageManagerRunner = "npx"
|
|
|
109834
109927
|
};
|
|
109835
109928
|
|
|
109836
109929
|
// src/utils.ts
|
|
109930
|
+
var import_adm_zip = __toESM(require_adm_zip());
|
|
109931
|
+
init_is_wsl();
|
|
109837
109932
|
var baseKey = ".capgo_key";
|
|
109838
109933
|
var baseKeyPub = `${baseKey}.pub`;
|
|
109839
109934
|
var defaultHost = "https://capgo.app";
|
|
@@ -110183,6 +110278,15 @@ async function prepareMultipart(supabase, appId, name) {
|
|
|
110183
110278
|
return null;
|
|
110184
110279
|
}
|
|
110185
110280
|
}
|
|
110281
|
+
function zipFile(filePath) {
|
|
110282
|
+
if (import_node_os2.default.release().toLowerCase().includes("microsoft") && !is_wsl_default) {
|
|
110283
|
+
f2.error(`Windows powershell is not supported, please use WSL or a Linux distribution`);
|
|
110284
|
+
program.error("");
|
|
110285
|
+
}
|
|
110286
|
+
const zip = new import_adm_zip.default();
|
|
110287
|
+
zip.addLocalFolder(filePath);
|
|
110288
|
+
return zip.toBuffer();
|
|
110289
|
+
}
|
|
110186
110290
|
async function finishMultipartDownload(key2, uploadId, url, parts) {
|
|
110187
110291
|
const metadata = {
|
|
110188
110292
|
action: "mpu-complete",
|
|
@@ -110505,103 +110609,10 @@ async function getUserId(options) {
|
|
|
110505
110609
|
$e(`Done \u2705: ${userId}`);
|
|
110506
110610
|
}
|
|
110507
110611
|
|
|
110508
|
-
// package.json
|
|
110509
|
-
var package_default = {
|
|
110510
|
-
name: "@capgo/cli",
|
|
110511
|
-
version: "4.10.21",
|
|
110512
|
-
description: "A CLI to upload to capgo servers",
|
|
110513
|
-
author: "github.com/riderx",
|
|
110514
|
-
license: "Apache 2.0",
|
|
110515
|
-
homepage: "https://github.com/Cap-go/CLIl#readme",
|
|
110516
|
-
repository: {
|
|
110517
|
-
type: "git",
|
|
110518
|
-
url: "git+https://github.com/Cap-go/CLI.git"
|
|
110519
|
-
},
|
|
110520
|
-
bugs: {
|
|
110521
|
-
url: "https://github.com/Cap-go/CLI/issues"
|
|
110522
|
-
},
|
|
110523
|
-
keywords: [
|
|
110524
|
-
"appflow alternative",
|
|
110525
|
-
"ionic",
|
|
110526
|
-
"capacitor",
|
|
110527
|
-
"auto update",
|
|
110528
|
-
"live update",
|
|
110529
|
-
"capgo",
|
|
110530
|
-
"cli",
|
|
110531
|
-
"upload",
|
|
110532
|
-
"capgo-cli"
|
|
110533
|
-
],
|
|
110534
|
-
main: "dist/index.js",
|
|
110535
|
-
bin: {
|
|
110536
|
-
capgo: "dist/index.js"
|
|
110537
|
-
},
|
|
110538
|
-
engines: {
|
|
110539
|
-
npm: ">=8.0.0",
|
|
110540
|
-
node: ">=18.0.0"
|
|
110541
|
-
},
|
|
110542
|
-
scripts: {
|
|
110543
|
-
build: "node build.mjs",
|
|
110544
|
-
dev: "NODE_ENV=development node build.mjs",
|
|
110545
|
-
"no-debug": "node dist/index.js",
|
|
110546
|
-
test: "npx --yes ts-node -T src/index.ts",
|
|
110547
|
-
"dev-build": "SUPA_DB=development node build.mjs",
|
|
110548
|
-
pack: "pkg",
|
|
110549
|
-
types: "npx --yes supabase gen types typescript --project-id=xvwzpoazmxkqosrdewyv > src/types/supabase.types.ts",
|
|
110550
|
-
test_rls: "ts-node ./test/test_headers_rls.ts",
|
|
110551
|
-
lint: 'eslint "src/**/*.ts" --fix'
|
|
110552
|
-
},
|
|
110553
|
-
dependencies: {
|
|
110554
|
-
"@aws-sdk/client-s3": "^3.588.0",
|
|
110555
|
-
"@capacitor/cli": "6.0.0",
|
|
110556
|
-
"@capgo/find-package-manager": "^0.0.17",
|
|
110557
|
-
"@clack/prompts": "^0.7.0",
|
|
110558
|
-
"@manypkg/find-root": "^2.2.1",
|
|
110559
|
-
"@supabase/supabase-js": "^2.43.4",
|
|
110560
|
-
"@tomasklaen/checksum": "^1.1.0",
|
|
110561
|
-
"@trufflesuite/spinnies": "^0.1.1",
|
|
110562
|
-
"adm-zip": "^0.5.13",
|
|
110563
|
-
"ci-info": "^4.0.0",
|
|
110564
|
-
commander: "12.1.0",
|
|
110565
|
-
"console-table-printer": "^2.12.0",
|
|
110566
|
-
"get-latest-version": "^5.1.0",
|
|
110567
|
-
ky: "^1.3.0",
|
|
110568
|
-
logsnag: "1.0.0",
|
|
110569
|
-
mime: "^4.0.3",
|
|
110570
|
-
"node-dir": "^0.1.17",
|
|
110571
|
-
open: "^10.1.0",
|
|
110572
|
-
prettyjson: "^1.2.5",
|
|
110573
|
-
"prompt-sync": "^4.2.0",
|
|
110574
|
-
semver: "^7.6.2"
|
|
110575
|
-
},
|
|
110576
|
-
devDependencies: {
|
|
110577
|
-
"@antfu/eslint-config": "^2.20.0",
|
|
110578
|
-
"@types/adm-zip": "0.5.5",
|
|
110579
|
-
"@types/mime": "^4.0.0",
|
|
110580
|
-
"@types/node": "^20.14.0",
|
|
110581
|
-
"@types/node-dir": "^0.0.37",
|
|
110582
|
-
"@types/npmcli__ci-detect": "^2.0.3",
|
|
110583
|
-
"@types/prettyjson": "^0.0.33",
|
|
110584
|
-
"@types/prompt-sync": "^4.2.3",
|
|
110585
|
-
"@types/semver": "^7.5.8",
|
|
110586
|
-
"@typescript-eslint/eslint-plugin": "^7.12.0",
|
|
110587
|
-
"@typescript-eslint/parser": "^7.12.0",
|
|
110588
|
-
esbuild: "^0.21.4",
|
|
110589
|
-
eslint: "9.4.0",
|
|
110590
|
-
"git-format-staged": "3.1.1",
|
|
110591
|
-
husky: "^9.0.11",
|
|
110592
|
-
pkg: "5.8.1",
|
|
110593
|
-
"ts-loader": "^9.5.1",
|
|
110594
|
-
"ts-node": "^10.9.2",
|
|
110595
|
-
"tsconfig-paths": "4.2.0",
|
|
110596
|
-
typescript: "5.4.5"
|
|
110597
|
-
}
|
|
110598
|
-
};
|
|
110599
|
-
|
|
110600
110612
|
// src/bundle/zip.ts
|
|
110601
110613
|
var import_node_crypto = require("node:crypto");
|
|
110602
110614
|
var import_node_fs6 = require("node:fs");
|
|
110603
110615
|
var import_node_process9 = __toESM(require("node:process"));
|
|
110604
|
-
var import_adm_zip = __toESM(require_adm_zip());
|
|
110605
110616
|
var import_checksum = __toESM(require_dist13());
|
|
110606
110617
|
|
|
110607
110618
|
// src/api/update.ts
|
|
@@ -110703,9 +110714,7 @@ async function zipBundle(appId, options) {
|
|
|
110703
110714
|
program.error("");
|
|
110704
110715
|
}
|
|
110705
110716
|
}
|
|
110706
|
-
const
|
|
110707
|
-
zip.addLocalFolder(path3);
|
|
110708
|
-
const zipped = zip.toBuffer();
|
|
110717
|
+
const zipped = zipFile(path3);
|
|
110709
110718
|
if (!json)
|
|
110710
110719
|
f2.info(`Zipped ${zipped.byteLength} bytes`);
|
|
110711
110720
|
const s = de();
|
|
@@ -111079,8 +111088,8 @@ async function createKey(options, log = true) {
|
|
|
111079
111088
|
oe(`Create keys \u{1F511}`);
|
|
111080
111089
|
const { publicKey, privateKey } = createRSA();
|
|
111081
111090
|
if ((0, import_node_fs7.existsSync)(baseKeyPub) && !options.force) {
|
|
111091
|
+
f2.error("Public Key already exists, use --force to overwrite");
|
|
111082
111092
|
if (log) {
|
|
111083
|
-
f2.error("Public Key already exists, use --force to overwrite");
|
|
111084
111093
|
program.error("");
|
|
111085
111094
|
} else {
|
|
111086
111095
|
return false;
|
|
@@ -111088,8 +111097,8 @@ async function createKey(options, log = true) {
|
|
|
111088
111097
|
}
|
|
111089
111098
|
(0, import_node_fs7.writeFileSync)(baseKeyPub, publicKey);
|
|
111090
111099
|
if ((0, import_node_fs7.existsSync)(baseKey) && !options.force) {
|
|
111100
|
+
f2.error("Private Key already exists, use --force to overwrite");
|
|
111091
111101
|
if (log) {
|
|
111092
|
-
f2.error("Private Key already exists, use --force to overwrite");
|
|
111093
111102
|
program.error("");
|
|
111094
111103
|
} else {
|
|
111095
111104
|
return false;
|
|
@@ -111162,7 +111171,14 @@ async function checkVersionNotUsedInChannel(supabase, appid, versionData) {
|
|
|
111162
111171
|
}
|
|
111163
111172
|
}
|
|
111164
111173
|
function findUnknownVersion(supabase, appId) {
|
|
111165
|
-
return supabase.from("app_versions").select("id").eq("app_id", appId).eq("name", "unknown").throwOnError().single().then(({ data }) =>
|
|
111174
|
+
return supabase.from("app_versions").select("id").eq("app_id", appId).eq("name", "unknown").throwOnError().single().then(({ data, error }) => {
|
|
111175
|
+
if (error) {
|
|
111176
|
+
f2.error(`Cannot call findUnknownVersion as it returned an error.
|
|
111177
|
+
${formatError(error)}`);
|
|
111178
|
+
program.error("");
|
|
111179
|
+
}
|
|
111180
|
+
return data;
|
|
111181
|
+
});
|
|
111166
111182
|
}
|
|
111167
111183
|
function createChannel(supabase, update) {
|
|
111168
111184
|
return supabase.from("channels").insert(update).select().single();
|
|
@@ -111251,12 +111267,17 @@ async function addChannel(channelId, appId, options, shouldExit = true) {
|
|
|
111251
111267
|
f2.error(`Cannot find default version for channel creation, please contact Capgo support \u{1F928}`);
|
|
111252
111268
|
program.error("");
|
|
111253
111269
|
}
|
|
111254
|
-
await createChannel(supabase, {
|
|
111270
|
+
const res = await createChannel(supabase, {
|
|
111255
111271
|
name: channelId,
|
|
111256
111272
|
app_id: appId,
|
|
111257
111273
|
version: data.id,
|
|
111258
111274
|
owner_org: orgId
|
|
111259
111275
|
});
|
|
111276
|
+
if (res.error) {
|
|
111277
|
+
f2.error(`Cannot create Channel \u{1F640}
|
|
111278
|
+
${formatError(res.error)}`);
|
|
111279
|
+
program.error("");
|
|
111280
|
+
}
|
|
111260
111281
|
f2.success(`Channel created \u2705`);
|
|
111261
111282
|
await snag.track({
|
|
111262
111283
|
channel: "channel",
|
|
@@ -111288,7 +111309,6 @@ var import_node_crypto3 = require("node:crypto");
|
|
|
111288
111309
|
var import_node_fs8 = require("node:fs");
|
|
111289
111310
|
var import_node_process13 = __toESM(require("node:process"));
|
|
111290
111311
|
var import_node_perf_hooks = require("node:perf_hooks");
|
|
111291
|
-
var import_adm_zip2 = __toESM(require_adm_zip());
|
|
111292
111312
|
var import_checksum2 = __toESM(require_dist13());
|
|
111293
111313
|
var import_ci_info = __toESM(require_ci_info());
|
|
111294
111314
|
var import_client_s3 = __toESM(require_dist_cjs71());
|
|
@@ -111433,9 +111453,7 @@ Trial expires in ${isTrial} days`);
|
|
|
111433
111453
|
let checksum = "";
|
|
111434
111454
|
let zipped = null;
|
|
111435
111455
|
if (!external && useS3 === false) {
|
|
111436
|
-
|
|
111437
|
-
zip.addLocalFolder(path3);
|
|
111438
|
-
zipped = zip.toBuffer();
|
|
111456
|
+
zipped = zipFile(path3);
|
|
111439
111457
|
const s = de();
|
|
111440
111458
|
s.start(`Calculating checksum`);
|
|
111441
111459
|
checksum = await (0, import_checksum2.checksum)(zipped, "crc32");
|
|
@@ -111504,9 +111522,7 @@ The app size is ${mbSize} Mb, this may take a while to download for users
|
|
|
111504
111522
|
program.error("");
|
|
111505
111523
|
} else {
|
|
111506
111524
|
if (useS3) {
|
|
111507
|
-
|
|
111508
|
-
zip.addLocalFolder(path3);
|
|
111509
|
-
zipped = zip.toBuffer();
|
|
111525
|
+
zipped = zipFile(path3);
|
|
111510
111526
|
const s = de();
|
|
111511
111527
|
s.start(`Calculating checksum`);
|
|
111512
111528
|
checksum = await (0, import_checksum2.checksum)(zipped, "crc32");
|
|
@@ -111975,7 +111991,7 @@ async function step2(organization, snag, appId, options) {
|
|
|
111975
111991
|
else
|
|
111976
111992
|
s.stop(`App add Done \u2705`);
|
|
111977
111993
|
} else {
|
|
111978
|
-
f2.info(`
|
|
111994
|
+
f2.info(`If you change your mind, run it for yourself with: "${pm2.runner} @capgo/cli@latest app add ${appId}"`);
|
|
111979
111995
|
}
|
|
111980
111996
|
await markStep(organization.gid, snag, 2);
|
|
111981
111997
|
}
|
|
@@ -111995,7 +112011,7 @@ async function step3(orgId, snag, apikey, appId) {
|
|
|
111995
112011
|
else
|
|
111996
112012
|
s.stop(`Channel add Done \u2705`);
|
|
111997
112013
|
} else {
|
|
111998
|
-
f2.info(`
|
|
112014
|
+
f2.info(`If you change your mind, run it for yourself with: "${pm2.runner} @capgo/cli@latest channel add ${defaultChannel} ${appId} --default"`);
|
|
111999
112015
|
}
|
|
112000
112016
|
await markStep(orgId, snag, 3);
|
|
112001
112017
|
}
|
|
@@ -112039,7 +112055,7 @@ async function step4(orgId, snag, apikey, appId) {
|
|
|
112039
112055
|
s.stop(`Install Done \u2705`);
|
|
112040
112056
|
}
|
|
112041
112057
|
} else {
|
|
112042
|
-
f2.info(`
|
|
112058
|
+
f2.info(`If you change your mind, run it for yourself with: "${pm2.installCommand} @capgo/capacitor-updater@latest"`);
|
|
112043
112059
|
}
|
|
112044
112060
|
await markStep(orgId, snag, 4);
|
|
112045
112061
|
}
|
|
@@ -112181,7 +112197,7 @@ async function step9(orgId, snag) {
|
|
|
112181
112197
|
await (0, import_node_child_process6.spawnSync)(pm2.runner, ["cap", "run", platform2], { stdio: "inherit" });
|
|
112182
112198
|
s.stop(`Started Done \u2705`);
|
|
112183
112199
|
} else {
|
|
112184
|
-
f2.info(`
|
|
112200
|
+
f2.info(`If you change your mind, run it for yourself with: ${pm2.runner} cap run <ios|android>`);
|
|
112185
112201
|
}
|
|
112186
112202
|
await markStep(orgId, snag, 9);
|
|
112187
112203
|
}
|
|
@@ -112384,8 +112400,8 @@ async function decryptZip(zipPath, ivsessionKey, options) {
|
|
|
112384
112400
|
const keyFile = (0, import_node_fs12.readFileSync)(keyPath);
|
|
112385
112401
|
privateKey = keyFile.toString();
|
|
112386
112402
|
}
|
|
112387
|
-
const
|
|
112388
|
-
const decodedZip = decryptSource(
|
|
112403
|
+
const zipFile2 = (0, import_node_fs12.readFileSync)(zipPath);
|
|
112404
|
+
const decodedZip = decryptSource(zipFile2, ivsessionKey, options.keyData ?? privateKey ?? "");
|
|
112389
112405
|
(0, import_node_fs12.writeFileSync)(`${zipPath}_decrypted.zip`, decodedZip);
|
|
112390
112406
|
$e(`Decrypted zip file at ${zipPath}_decrypted.zip`);
|
|
112391
112407
|
import_node_process19.default.exit();
|
|
@@ -112421,8 +112437,8 @@ async function encryptZip(zipPath, options) {
|
|
|
112421
112437
|
const keyFile = (0, import_node_fs13.readFileSync)(keyPath);
|
|
112422
112438
|
publicKey = keyFile.toString();
|
|
112423
112439
|
}
|
|
112424
|
-
const
|
|
112425
|
-
const encodedZip = encryptSource(
|
|
112440
|
+
const zipFile2 = (0, import_node_fs13.readFileSync)(zipPath);
|
|
112441
|
+
const encodedZip = encryptSource(zipFile2, publicKey);
|
|
112426
112442
|
f2.success(`ivSessionKey: ${encodedZip.ivSessionKey}`);
|
|
112427
112443
|
(0, import_node_fs13.writeFileSync)(`${zipPath}_encrypted.zip`, encodedZip.encryptedData);
|
|
112428
112444
|
f2.success(`Encrypted zip saved at ${zipPath}_encrypted.zip`);
|