UNPKG

shipthis

Version:

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

85 lines (82 loc) 3.05 kB
import { jsx } from 'react/jsx-runtime'; import * as fs from 'node:fs'; import { Args, Flags } from '@oclif/core'; import { render } from 'ink'; import { a as getProjectCredentials } from '../../../../index-BW7z-5sB.js'; import 'axios'; import 'crypto-js'; import 'uuid'; import { P as Platform, C as CredentialsType } from '../../../../baseCommand-CTn3KGH3.js'; import 'luxon'; import 'node:path'; import 'chalk'; import 'node:crypto'; import 'node:readline'; import 'node:url'; import 'readline-sync'; import 'isomorphic-git'; import '@tanstack/react-query'; import 'react'; import 'fast-glob'; import 'yazl'; import 'socket.io-client'; import 'fullscreen-ink'; import 'ink-spinner'; import 'string-length'; import 'strip-ansi'; import 'open'; import '@inkjs/ui'; import { c as BaseGameCommand } from '../../../../baseGameCommand-8VL7xe-O.js'; import 'marked'; import 'marked-terminal'; import 'qrcode'; import { R as RunWithSpinner } from '../../../../RunWithSpinner-DucRnFp6.js'; import { C as Command } from '../../../../Command-Cj6F5B5a.js'; import { e as exportCredential } from '../../../../export-DtATljiz.js'; import '@expo/apple-utils/build/index.js'; import 'deepmerge'; import 'ini'; import 'fs'; import 'path'; class GameAndroidKeyStoreExport extends BaseGameCommand { static args = { file: Args.string({ description: "Name of the ZIP file to create", required: true }) }; static description = "Saves the current Android Keystore to a ZIP file"; static examples = ["<%= config.bin %> <%= command.id %> keyStore.zip"]; static flags = { force: Flags.boolean({ char: "f", description: "Overwrite the file if it already exists" }), gameId: Flags.string({ char: "g", description: "The ID of the game" }) }; async run() { const { args, flags } = this; const { file } = args; const { force } = flags; const game = await this.getGame(); const zipAlreadyExists = fs.existsSync(file); if (zipAlreadyExists && !force) { this.error(`The file ${file} already exists. Use --force to overwrite it.`); } const projectCredentials = await getProjectCredentials(game.id); const projectAndroidKeyStoreCreds = projectCredentials.filter( (cred) => cred.platform === Platform.ANDROID && cred.type === CredentialsType.CERTIFICATE && cred.isActive ); if (projectAndroidKeyStoreCreds.length === 0) { this.error("No Android Keystore found which can be exported."); } const [keyStore] = projectAndroidKeyStoreCreds; const handleComplete = async () => process.exit(0); render( /* @__PURE__ */ jsx(Command, { command: this, children: /* @__PURE__ */ jsx( RunWithSpinner, { executeMethod: () => exportCredential({ credentialId: keyStore.id, projectId: game.id, zipPath: file }), msgComplete: `Android Keystore exported to ${file}`, msgInProgress: `Exporting Android Keystore to ${file}...`, onComplete: handleComplete } ) }) ); } } export { GameAndroidKeyStoreExport as default };