UNPKG

shipthis

Version:

ShipThis manages building and uploading your Godot games to the App Store and Google Play.

89 lines (86 loc) 3.01 kB
import { jsx } from 'react/jsx-runtime'; import * as fs from 'node:fs'; import { Args, Flags } from '@oclif/core'; import { render } from 'ink'; import { g as getUserCredentials } from '../../../index-izrACZbC.js'; import { B as BaseAuthenticatedCommand, P as Platform, C as CredentialsType } from '../../../index-BwnzoldS.js'; import 'ink-spinner'; import 'node:crypto'; import 'node:path'; import 'node:readline'; import 'node:url'; import 'readline-sync'; import 'luxon'; import 'axios'; import 'isomorphic-git'; import '@tanstack/react-query'; import 'react'; import 'crypto-js'; import 'uuid'; import 'fast-glob'; import 'yazl'; import 'socket.io-client'; import 'fullscreen-ink'; import 'string-length'; import 'strip-ansi'; import 'open'; import '@inkjs/ui'; import '../../../ejs-DirFZbza.js'; import 'marked'; import 'marked-terminal'; import 'qrcode'; import { R as RunWithSpinner } from '../../../RunWithSpinner-DucRnFp6.js'; import '../../../index-hoHfGrjg.js'; import { C as Command } from '../../../Command-DN1j3tjt.js'; import { i as importCredential } from '../../../import-BpGyif-m.js'; import '@expo/apple-utils/build/index.js'; import 'deepmerge'; import 'ini'; import 'fs'; import 'path'; import '../../../index-CJWMt1s-.js'; import '../../../useAndroidServiceAccountTestResult-CwKeW0ED.js'; class AppleApiKeyImport extends BaseAuthenticatedCommand { static args = { file: Args.string({ description: "Name of the ZIP file to import (must be in the same format as the export)", required: true }) }; static description = "Imports an App Store Connect API Key ZIP file into your ShipThis account"; static examples = ["<%= config.bin %> <%= command.id %> userApiKey.zip"]; static flags = { force: Flags.boolean({ char: "f" }) }; async run() { const { args, flags } = this; const { file } = args; const { force } = flags; const zipFound = fs.existsSync(file); if (!zipFound) { this.error(`The file ${file} does not exist.`); } const userCredentials = await getUserCredentials(); const userAppleApiKeyCredentials = userCredentials.filter( (cred) => cred.platform === Platform.IOS && cred.type === CredentialsType.KEY ); if (userAppleApiKeyCredentials.length > 0 && !force) { this.error("An App Store Connect API Key already exists. Use --force to overwrite it."); } const handleComplete = async () => { await this.config.runCommand(`apple:apiKey:status`, ["--noAppleAuth"]); }; render( /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx( RunWithSpinner, { executeMethod: () => importCredential({ platform: Platform.IOS, type: CredentialsType.KEY, zipPath: file }), msgComplete: `App Store Connect API imported from ${file}`, msgInProgress: `Importing App Store Connect API from ${file}...`, onComplete: handleComplete } ) }) ); } } export { AppleApiKeyImport as default };