shipthis 0.0.41 → 0.1.1
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/README.md +17 -17
- package/dist/{AppleBundleIdDetails-n1_U8IqK.js → AppleBundleIdDetails-BF-Pm1Ia.js} +19 -7
- package/dist/Command-BrfJSeOC.js +1077 -0
- package/dist/CommandGame-D9wl8hfX.js +8 -0
- package/dist/{NextSteps-CK9zHOCt.js → NextSteps-DKcjSHZ3.js} +1 -1
- package/dist/ProjectCredentialsTable-BVvkIPjN.js +36 -0
- package/dist/{StatusTable-CxuX_R1D.js → StatusTable-BzsNF75L.js} +2 -7
- package/dist/{UserCredentialsTable-A_YlFeJX.js → UserCredentialsTable-DUFQqHVt.js} +11 -5
- package/dist/{baseAppleCommand-DK5-Cvg4.js → baseAppleCommand-BSJhK8GA.js} +1 -1
- package/dist/baseGameAndroidCommand-CPAtReqy.js +43 -0
- package/dist/commands/apple/apiKey/create.js +24 -10
- package/dist/commands/apple/apiKey/export.js +23 -9
- package/dist/commands/apple/apiKey/import.js +23 -9
- package/dist/commands/apple/apiKey/status.js +25 -13
- package/dist/commands/apple/certificate/create.js +25 -11
- package/dist/commands/apple/certificate/export.js +23 -9
- package/dist/commands/apple/certificate/import.js +23 -9
- package/dist/commands/apple/certificate/status.js +26 -14
- package/dist/commands/apple/login.js +9 -3
- package/dist/commands/apple/status.js +27 -13
- package/dist/commands/dashboard.js +11 -5
- package/dist/commands/game/android/apiKey/connect.js +73 -0
- package/dist/commands/game/android/apiKey/create.js +70 -0
- package/dist/commands/game/android/apiKey/export.js +83 -0
- package/dist/commands/game/android/apiKey/import.js +92 -0
- package/dist/commands/game/android/apiKey/invite.js +81 -0
- package/dist/commands/game/android/apiKey/status.js +86 -0
- package/dist/commands/game/android/keyStore/create.js +67 -0
- package/dist/commands/game/android/keyStore/export.js +82 -0
- package/dist/commands/game/android/keyStore/import.js +91 -0
- package/dist/commands/game/android/keyStore/status.js +69 -0
- package/dist/commands/game/android/status.js +84 -0
- package/dist/commands/game/android/wizard.js +53 -0
- package/dist/commands/game/build/download.js +23 -9
- package/dist/commands/game/build/list.js +25 -14
- package/dist/commands/game/create.js +18 -10
- package/dist/commands/game/details.js +28 -19
- package/dist/commands/game/export.js +11 -5
- package/dist/commands/game/ios/app/addTester.js +25 -12
- package/dist/commands/game/ios/app/create.js +26 -13
- package/dist/commands/game/ios/app/status.js +27 -13
- package/dist/commands/game/ios/app/sync.js +23 -9
- package/dist/commands/game/ios/profile/create.js +22 -8
- package/dist/commands/game/ios/profile/export.js +23 -9
- package/dist/commands/game/ios/profile/import.js +23 -9
- package/dist/commands/game/ios/profile/status.js +26 -71
- package/dist/commands/game/ios/status.js +28 -15
- package/dist/commands/game/ios/wizard.js +125 -0
- package/dist/commands/game/job/list.js +26 -14
- package/dist/commands/game/job/status.js +26 -71
- package/dist/commands/game/list.js +26 -12
- package/dist/commands/game/ship.js +7 -4
- package/dist/commands/game/status.js +63 -25
- package/dist/commands/game/wizard.js +41 -99
- package/dist/commands/internal/fastlane.js +74 -0
- package/dist/commands/internal/readme.js +1452 -0
- package/dist/commands/login.js +9 -3
- package/dist/commands/status.js +23 -10
- package/dist/{export-C16psune.js → export-B0FJT0EU.js} +1 -1
- package/dist/{import-hte2Jy0K.js → import-CLDJ2iPu.js} +1 -1
- package/dist/{baseGameCommand-B3NbuvDu.js → index-CF0fIsx2.js} +112 -37
- package/dist/index-CFHmtzfq.js +24 -0
- package/dist/{index-ZHJdUrwJ.js → index-Df8uXQ4s.js} +14 -3
- package/dist/{upload-DADrkIUB.js → upload-C5L82Yq0.js} +1 -1
- package/dist/useAndroidServiceAccountTestResult-BnxNuoG3.js +52 -0
- package/dist/{useAppleApp-Cr3VcGVs.js → useAppleApp-IXRdsK5w.js} +1 -1
- package/dist/{useAppleBundleId-BxtyGpHy.js → useAppleBundleId-DYC5ISKT.js} +1 -1
- package/docs/game/android/apiKey/connect.md +27 -0
- package/docs/game/android/apiKey/create.md +25 -0
- package/docs/game/android/apiKey/export.md +25 -0
- package/docs/game/android/apiKey/import.md +25 -0
- package/docs/game/android/apiKey/invite.md +27 -0
- package/docs/game/android/apiKey/status.md +23 -0
- package/docs/game/android/apiKey.md +165 -0
- package/docs/game/android/keyStore/create.md +24 -0
- package/docs/game/android/keyStore/export.md +25 -0
- package/docs/game/android/keyStore/import.md +25 -0
- package/docs/game/android/keyStore/status.md +23 -0
- package/docs/game/android/keyStore.md +108 -0
- package/docs/game/android/status.md +23 -0
- package/docs/game/android/wizard.md +28 -0
- package/docs/game/android.md +339 -0
- package/docs/game/create.md +12 -7
- package/docs/game/ios/wizard.md +21 -0
- package/docs/game/wizard.md +12 -18
- package/oclif.manifest.json +914 -161
- package/package.json +54 -19
- package/dist/App-BfoOFeZ-.js +0 -21
- package/dist/RunWithSpinner-BVXNWGD3.js +0 -27
- package/dist/Title-BCQtayg6.js +0 -6
- package/dist/cacheKeys-CShA-ZjE.js +0 -9
- package/dist/useBuilds-JHqMwpWS.js +0 -41
- package/dist/useJob-Bc9fdiyP.js +0 -34
|
@@ -1,31 +1,63 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { render } from 'ink';
|
|
3
3
|
import { Flags } from '@oclif/core';
|
|
4
|
-
import {
|
|
5
|
-
import 'ink-spinner';
|
|
6
|
-
import { d as BaseGameCommand, e as getProjectPlatformProgress, P as Platform, f as getShortDate } from '../../baseGameCommand-B3NbuvDu.js';
|
|
7
|
-
import { g as getShortUUID, m as makeHumanReadable } from '../../index-ZHJdUrwJ.js';
|
|
4
|
+
import { C as Command } from '../../Command-BrfJSeOC.js';
|
|
8
5
|
import 'react';
|
|
9
|
-
import
|
|
10
|
-
import '
|
|
11
|
-
import '@
|
|
12
|
-
import '
|
|
6
|
+
import 'ink-spinner';
|
|
7
|
+
import { B as BaseAuthenticatedCommand, H as getProject, P as Platform, k as getProjectPlatformProgress, b as getShortDate } from '../../index-CF0fIsx2.js';
|
|
8
|
+
import '@inkjs/ui';
|
|
9
|
+
import { g as getShortUUID, m as makeHumanReadable } from '../../index-Df8uXQ4s.js';
|
|
13
10
|
import 'axios';
|
|
14
|
-
import
|
|
15
|
-
import '
|
|
11
|
+
import '@tanstack/react-query';
|
|
12
|
+
import 'marked';
|
|
13
|
+
import 'fs';
|
|
14
|
+
import 'marked-terminal';
|
|
15
|
+
import { N as NextSteps } from '../../NextSteps-DKcjSHZ3.js';
|
|
16
|
+
import 'qrcode';
|
|
17
|
+
import { S as StatusTable } from '../../StatusTable-BzsNF75L.js';
|
|
16
18
|
import 'string-length';
|
|
17
19
|
import 'strip-ansi';
|
|
18
|
-
import '
|
|
19
|
-
import '
|
|
20
|
+
import 'luxon';
|
|
21
|
+
import 'uuid';
|
|
22
|
+
import 'fast-glob';
|
|
23
|
+
import 'yazl';
|
|
24
|
+
import 'socket.io-client';
|
|
25
|
+
import 'open';
|
|
26
|
+
import 'crypto-js';
|
|
27
|
+
import '../../useAndroidServiceAccountTestResult-BnxNuoG3.js';
|
|
20
28
|
import 'crypto';
|
|
21
29
|
import 'readline-sync';
|
|
22
30
|
import 'node:readline';
|
|
31
|
+
import 'node:path';
|
|
32
|
+
import 'node:url';
|
|
23
33
|
import 'isomorphic-git';
|
|
34
|
+
import '../../git-DREGq-jc.js';
|
|
35
|
+
import '../../index-CFHmtzfq.js';
|
|
36
|
+
import 'path';
|
|
37
|
+
import '@expo/apple-utils/build/index.js';
|
|
24
38
|
import 'ini';
|
|
25
39
|
import 'deepmerge';
|
|
26
|
-
import '../../Title-BCQtayg6.js';
|
|
27
40
|
|
|
28
|
-
|
|
41
|
+
function getSteps(platform, progress) {
|
|
42
|
+
if (!progress) return [];
|
|
43
|
+
switch (platform) {
|
|
44
|
+
case Platform.ANDROID:
|
|
45
|
+
return [
|
|
46
|
+
!progress.hasCredentialsForPlatform && "$ shipthis game android keyStore create",
|
|
47
|
+
!progress.hasApiKeyForPlatform && "$ shipthis game android apiKey create",
|
|
48
|
+
progress.hasCredentialsForPlatform && progress.hasApiKeyForPlatform && "$ shipthis game ship"
|
|
49
|
+
].filter(Boolean);
|
|
50
|
+
case Platform.IOS:
|
|
51
|
+
return [
|
|
52
|
+
!progress.hasApiKeyForPlatform && "$ shipthis apple apiKey create",
|
|
53
|
+
!progress.hasCredentialsForPlatform && "$ shipthis game ios profile create",
|
|
54
|
+
progress.hasApiKeyForPlatform && progress.hasCredentialsForPlatform && "$ shipthis game ship"
|
|
55
|
+
].filter(Boolean);
|
|
56
|
+
default:
|
|
57
|
+
throw new Error("Invalid platform");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
class GameStatus extends BaseAuthenticatedCommand {
|
|
29
61
|
static args = {};
|
|
30
62
|
static description = "Shows the status of the current game.";
|
|
31
63
|
static examples = [
|
|
@@ -36,21 +68,26 @@ class GameStatus extends BaseGameCommand {
|
|
|
36
68
|
gameId: Flags.string({ char: "g", description: "The ID of the game" })
|
|
37
69
|
};
|
|
38
70
|
async run() {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
71
|
+
const gameId = await this.getGameId();
|
|
72
|
+
if (!gameId) {
|
|
73
|
+
this.error("No game found - please run `shipthis game wizard` or specify a game ID with --gameId", { exit: 1 });
|
|
74
|
+
}
|
|
75
|
+
const game = await getProject(gameId);
|
|
76
|
+
const hasConfiguredIos = !!game.details?.iosBundleId;
|
|
77
|
+
const hasConfiguredAndroid = !!game.details?.androidPackageName;
|
|
78
|
+
let statuses = {
|
|
79
|
+
[Platform.IOS]: hasConfiguredIos ? await getProjectPlatformProgress(game.id, Platform.IOS) : null,
|
|
80
|
+
[Platform.ANDROID]: hasConfiguredAndroid ? await getProjectPlatformProgress(game.id, Platform.ANDROID) : null
|
|
81
|
+
};
|
|
82
|
+
let steps = [];
|
|
83
|
+
if (hasConfiguredIos) steps = steps.concat(getSteps(Platform.IOS, statuses[Platform.IOS]));
|
|
84
|
+
if (hasConfiguredAndroid) steps = steps.concat(getSteps(Platform.ANDROID, statuses[Platform.ANDROID]));
|
|
48
85
|
const progressToStatuses = (progress) => {
|
|
49
86
|
const { platform, ...rest } = progress;
|
|
50
87
|
return makeHumanReadable(rest);
|
|
51
88
|
};
|
|
52
89
|
render(
|
|
53
|
-
/* @__PURE__ */ jsxs(
|
|
90
|
+
/* @__PURE__ */ jsxs(Command, { command: this, children: [
|
|
54
91
|
/* @__PURE__ */ jsx(
|
|
55
92
|
StatusTable,
|
|
56
93
|
{
|
|
@@ -66,7 +103,8 @@ class GameStatus extends BaseGameCommand {
|
|
|
66
103
|
}
|
|
67
104
|
}
|
|
68
105
|
),
|
|
69
|
-
/* @__PURE__ */ jsx(StatusTable, { title: "iOS Status", statuses: progressToStatuses(
|
|
106
|
+
statuses[Platform.IOS] && /* @__PURE__ */ jsx(StatusTable, { title: "iOS Status", statuses: progressToStatuses(statuses[Platform.IOS]) }),
|
|
107
|
+
statuses[Platform.ANDROID] && /* @__PURE__ */ jsx(StatusTable, { title: "Android Status", statuses: progressToStatuses(statuses[Platform.ANDROID]) }),
|
|
70
108
|
/* @__PURE__ */ jsx(NextSteps, { steps })
|
|
71
109
|
] })
|
|
72
110
|
);
|
|
@@ -1,124 +1,66 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import prompts from 'prompts';
|
|
3
|
+
import { B as BaseAuthenticatedCommand, j as isCWDGodotGame, P as Platform } from '../../index-CF0fIsx2.js';
|
|
3
4
|
import 'path';
|
|
4
5
|
import 'fs';
|
|
5
6
|
import '@expo/apple-utils/build/index.js';
|
|
6
7
|
import 'axios';
|
|
8
|
+
import 'crypto-js';
|
|
9
|
+
import 'uuid';
|
|
7
10
|
import 'luxon';
|
|
8
11
|
import 'crypto';
|
|
9
12
|
import 'readline-sync';
|
|
10
13
|
import 'node:readline';
|
|
14
|
+
import 'node:path';
|
|
15
|
+
import 'node:url';
|
|
11
16
|
import 'react';
|
|
12
17
|
import '@tanstack/react-query';
|
|
13
|
-
import 'socket.io-client';
|
|
14
|
-
import 'isomorphic-git';
|
|
15
18
|
import 'ini';
|
|
16
19
|
import 'deepmerge';
|
|
20
|
+
import 'fast-glob';
|
|
21
|
+
import 'yazl';
|
|
22
|
+
import 'socket.io-client';
|
|
23
|
+
import 'isomorphic-git';
|
|
17
24
|
|
|
18
25
|
class GameWizard extends BaseAuthenticatedCommand {
|
|
19
|
-
static args = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
forceStep: Flags.string({
|
|
24
|
-
char: "f",
|
|
25
|
-
description: "Force a specific step to run."
|
|
26
|
-
}),
|
|
27
|
-
platform: Flags.string({
|
|
28
|
-
char: "p",
|
|
29
|
-
description: "The platform to run the wizard for",
|
|
30
|
-
options: [
|
|
31
|
-
"ios"
|
|
32
|
-
/* TODO - android */
|
|
33
|
-
],
|
|
34
|
-
required: false,
|
|
35
|
-
default: "ios"
|
|
26
|
+
static args = {
|
|
27
|
+
platform: Args.string({
|
|
28
|
+
description: 'The platform to run the wizard for. This can be "android" or "ios"',
|
|
29
|
+
required: false
|
|
36
30
|
})
|
|
37
31
|
};
|
|
32
|
+
static description = "Runs all the steps for the specific platform";
|
|
33
|
+
static examples = ["<%= config.bin %> <%= command.id %> ios", "<%= config.bin %> <%= command.id %> android"];
|
|
34
|
+
static flags = {};
|
|
38
35
|
async run() {
|
|
39
|
-
const {
|
|
36
|
+
const { args } = this;
|
|
40
37
|
if (!isCWDGodotGame()) {
|
|
41
38
|
this.error("No Godot project detected. Please run this from a godot project directory.", { exit: 1 });
|
|
42
39
|
}
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
|
|
49
|
-
args: ["--quiet"],
|
|
50
|
-
shouldRun: async () => !game
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
command: "apple:login",
|
|
54
|
-
args: ["--quiet"],
|
|
55
|
-
shouldRun: async () => {
|
|
56
|
-
const isLoggedIn = await this.hasValidAppleAuthState();
|
|
57
|
-
return !isLoggedIn;
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
command: "apple:apiKey:create",
|
|
62
|
-
args: ["--quiet"],
|
|
63
|
-
shouldRun: async () => {
|
|
64
|
-
const userCredentials = await getUserCredentials();
|
|
65
|
-
const userAppleApiKeyCredentials = userCredentials.filter(
|
|
66
|
-
(cred) => cred.platform == Platform.IOS && cred.type == CredentialsType.KEY
|
|
67
|
-
);
|
|
68
|
-
return userAppleApiKeyCredentials.length === 0;
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
command: "apple:certificate:create",
|
|
73
|
-
args: ["--quiet"],
|
|
74
|
-
shouldRun: async () => {
|
|
75
|
-
const userCredentials = await getUserCredentials();
|
|
76
|
-
const userAppleDistCredentials = userCredentials.filter(
|
|
77
|
-
(cred) => cred.platform == Platform.IOS && cred.type == CredentialsType.CERTIFICATE
|
|
78
|
-
);
|
|
79
|
-
return userAppleDistCredentials.length === 0;
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
command: "game:ios:app:create",
|
|
84
|
-
args: ["--quiet"],
|
|
85
|
-
shouldRun: async () => {
|
|
86
|
-
if (!game) return true;
|
|
87
|
-
const hasBundleIdSet = !!game.details?.iosBundleId;
|
|
88
|
-
return !hasBundleIdSet;
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
command: "game:ios:app:sync",
|
|
93
|
-
args: ["--quiet"],
|
|
94
|
-
// Can always run this
|
|
95
|
-
shouldRun: async () => true
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
command: "game:ios:profile:create",
|
|
99
|
-
args: ["--quiet"],
|
|
100
|
-
shouldRun: async () => {
|
|
101
|
-
if (!game) return true;
|
|
102
|
-
const projectCredentials = await getProjectCredentials(game.id);
|
|
103
|
-
const projectAppleProfileCredentials = projectCredentials.filter(
|
|
104
|
-
(cred) => cred.platform == Platform.IOS && cred.type == CredentialsType.CERTIFICATE
|
|
105
|
-
);
|
|
106
|
-
return projectAppleProfileCredentials.length === 0;
|
|
107
|
-
}
|
|
40
|
+
const runForPlatform = async (platform) => {
|
|
41
|
+
console.clear();
|
|
42
|
+
if (platform === Platform.ANDROID) {
|
|
43
|
+
return this.config.runCommand("game:android:wizard");
|
|
44
|
+
} else if (platform === Platform.IOS) {
|
|
45
|
+
return this.config.runCommand("game:ios:wizard");
|
|
108
46
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
this.debug(`Skipping step: ${command}`);
|
|
115
|
-
continue;
|
|
116
|
-
}
|
|
117
|
-
const args = [...step.args, ...isStepForced(command) ? ["--force"] : []];
|
|
118
|
-
this.debug(`Running step: ${command} with args: ${args.join(" ")}`);
|
|
119
|
-
await this.config.runCommand(command, args);
|
|
47
|
+
process.exit(0);
|
|
48
|
+
};
|
|
49
|
+
if (args.platform) {
|
|
50
|
+
await runForPlatform(args.platform);
|
|
51
|
+
return;
|
|
120
52
|
}
|
|
121
|
-
await
|
|
53
|
+
const response = await prompts({
|
|
54
|
+
type: "select",
|
|
55
|
+
name: "platform",
|
|
56
|
+
message: "Please select a platform",
|
|
57
|
+
choices: [
|
|
58
|
+
{ title: "Android", value: Platform.ANDROID },
|
|
59
|
+
{ title: "iOS", value: Platform.IOS }
|
|
60
|
+
],
|
|
61
|
+
initial: 0
|
|
62
|
+
});
|
|
63
|
+
await runForPlatform(response.platform);
|
|
122
64
|
}
|
|
123
65
|
}
|
|
124
66
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import fs__default, { promises } from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { Args, Flags } from '@oclif/core';
|
|
4
|
+
import { S as BaseCommand } from '../../index-CF0fIsx2.js';
|
|
5
|
+
import '@expo/apple-utils/build/index.js';
|
|
6
|
+
import 'axios';
|
|
7
|
+
import 'crypto-js';
|
|
8
|
+
import 'uuid';
|
|
9
|
+
import 'luxon';
|
|
10
|
+
import 'crypto';
|
|
11
|
+
import 'readline-sync';
|
|
12
|
+
import 'node:readline';
|
|
13
|
+
import 'node:path';
|
|
14
|
+
import 'node:url';
|
|
15
|
+
import 'react';
|
|
16
|
+
import '@tanstack/react-query';
|
|
17
|
+
import 'ini';
|
|
18
|
+
import 'deepmerge';
|
|
19
|
+
import 'fast-glob';
|
|
20
|
+
import 'yazl';
|
|
21
|
+
import 'socket.io-client';
|
|
22
|
+
import 'isomorphic-git';
|
|
23
|
+
|
|
24
|
+
function generateFastlaneSession(cookieData) {
|
|
25
|
+
return cookieData.cookies.map((cookie) => {
|
|
26
|
+
return `- !ruby/object:HTTP::Cookie
|
|
27
|
+
name: ${cookie.key}
|
|
28
|
+
value: ${cookie.value}
|
|
29
|
+
domain: ${cookie.domain}
|
|
30
|
+
for_domain: ${cookie.hostOnly ? "false" : "true"}
|
|
31
|
+
path: "${cookie.path}"
|
|
32
|
+
secure: ${cookie.secure || false}
|
|
33
|
+
httponly: ${cookie.httpOnly || false}
|
|
34
|
+
expires: ${cookie.expires ? `"${cookie.expires}"` : ""}
|
|
35
|
+
max_age: ${cookie.maxAge || ""}
|
|
36
|
+
created_at: ${cookie.creation}
|
|
37
|
+
accessed_at: ${cookie.lastAccessed}`;
|
|
38
|
+
}).join("\n");
|
|
39
|
+
}
|
|
40
|
+
class AppleFastlane extends BaseCommand {
|
|
41
|
+
static args = {
|
|
42
|
+
username: Args.string({ description: "Your Apple email address", required: true }),
|
|
43
|
+
file: Args.string({ description: "Path where the fastlane session will be written", required: true })
|
|
44
|
+
};
|
|
45
|
+
static description = "Output a fastlane session file which can be used with xcodes";
|
|
46
|
+
static examples = [
|
|
47
|
+
"<%= config.bin %> <%= command.id %>",
|
|
48
|
+
"<%= config.bin %> <%= command.id %> --force --username me@email.nowhere"
|
|
49
|
+
];
|
|
50
|
+
static flags = {
|
|
51
|
+
force: Flags.boolean({ char: "f" })
|
|
52
|
+
};
|
|
53
|
+
async run() {
|
|
54
|
+
const { args } = this;
|
|
55
|
+
const { username, file } = args;
|
|
56
|
+
const homeDirectory = this.config.home;
|
|
57
|
+
const inputFilePath = path.join(homeDirectory, ".app-store", "auth", username, "cookie");
|
|
58
|
+
if (!fs__default.existsSync(inputFilePath)) {
|
|
59
|
+
throw new Error(`No expo auth file found for ${username}`);
|
|
60
|
+
}
|
|
61
|
+
if (fs__default.existsSync(file) && !this.flags.force) {
|
|
62
|
+
throw new Error(`The file ${file} already exists. Use --force to overwrite it.`);
|
|
63
|
+
}
|
|
64
|
+
const outputFilePath = file;
|
|
65
|
+
const fileContent = await promises.readFile(inputFilePath, "utf-8");
|
|
66
|
+
const cookieData = JSON.parse(fileContent);
|
|
67
|
+
const yamlContent = generateFastlaneSession(cookieData);
|
|
68
|
+
await promises.mkdir(path.dirname(outputFilePath), { recursive: true });
|
|
69
|
+
await promises.writeFile(outputFilePath, yamlContent, "utf-8");
|
|
70
|
+
console.log(`FASTLANE_SESSION written to ${outputFilePath}`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export { AppleFastlane as default };
|