lunel-cli 0.1.79 → 0.1.80
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/dist/index.js +18 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ import { createInterface } from "readline";
|
|
|
15
15
|
const DEFAULT_PROXY_URL = normalizeGatewayUrl(process.env.LUNEL_PROXY_URL || "https://gateway.lunel.dev");
|
|
16
16
|
const MANAGER_URL = normalizeGatewayUrl(process.env.LUNEL_MANAGER_URL || "https://manager.lunel.dev");
|
|
17
17
|
const CLI_ARGS = process.argv.slice(2);
|
|
18
|
+
const APPLE_REVIEW_CODE = "abcd";
|
|
18
19
|
import { createRequire } from "module";
|
|
19
20
|
const __require = createRequire(import.meta.url);
|
|
20
21
|
const VERSION = __require("../package.json").version;
|
|
@@ -210,7 +211,11 @@ function parseExtraPortsFromArgs(args) {
|
|
|
210
211
|
}
|
|
211
212
|
return Array.from(parsed).sort((a, b) => a - b);
|
|
212
213
|
}
|
|
214
|
+
function hasFlag(args, flag) {
|
|
215
|
+
return args.includes(flag);
|
|
216
|
+
}
|
|
213
217
|
const EXTRA_PORTS = parseExtraPortsFromArgs(CLI_ARGS);
|
|
218
|
+
const USE_APPLE_REVIEW_CODE = hasFlag(CLI_ARGS, "--abcd-code");
|
|
214
219
|
const SCAN_PORTS = Array.from(new Set([...DEV_PORTS, ...EXTRA_PORTS])).sort((a, b) => a - b);
|
|
215
220
|
function samePortSet(a, b) {
|
|
216
221
|
if (a.length !== b.length)
|
|
@@ -2890,10 +2895,19 @@ async function main() {
|
|
|
2890
2895
|
checkDataChannelBackpressure();
|
|
2891
2896
|
}
|
|
2892
2897
|
});
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2898
|
+
let codeToAssemble;
|
|
2899
|
+
if (USE_APPLE_REVIEW_CODE) {
|
|
2900
|
+
codeToAssemble = APPLE_REVIEW_CODE;
|
|
2901
|
+
currentSessionCode = codeToAssemble;
|
|
2902
|
+
console.log(`Using fixed review code: ${APPLE_REVIEW_CODE}`);
|
|
2903
|
+
}
|
|
2904
|
+
else {
|
|
2905
|
+
const qr = await createQrCode();
|
|
2906
|
+
codeToAssemble = qr.code;
|
|
2907
|
+
currentSessionCode = qr.code;
|
|
2908
|
+
displayQR(qr.code);
|
|
2909
|
+
}
|
|
2910
|
+
const assembled = await assembleWithCode(codeToAssemble);
|
|
2897
2911
|
resetReplayBuffer();
|
|
2898
2912
|
currentSessionCode = assembled.code;
|
|
2899
2913
|
currentSessionPassword = assembled.password;
|