crt-ship 0.1.0: CLI, Claude Code skills and templates for shipping mobile games to Google Play and the App Store
This commit is contained in:
commit
ecb3dc3dc3
64 changed files with 4509 additions and 0 deletions
22
cli/play/data-safety.ts
Normal file
22
cli/play/data-safety.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// Play Data safety form through applications.dataSafety (CSV import; replaces every earlier answer).
|
||||
// crt-ship play data-safety [--csv out.csv] [--dry]
|
||||
// Answers come from `dataSafety` in crt-ship.config.ts. --dry only writes / prints the CSV.
|
||||
import { writeFileSync } from 'node:fs';
|
||||
import type { Ctx } from '../lib/ctx';
|
||||
import { need } from '../lib/ctx';
|
||||
import { dataSafetyCsv } from '../lib/data-safety';
|
||||
import { done, log } from '../lib/log';
|
||||
import { playClient } from './client';
|
||||
|
||||
export async function run(ctx: Ctx): Promise<void> {
|
||||
const { config, root, resolve } = ctx.loaded;
|
||||
const csv = dataSafetyCsv(need(config.dataSafety, 'dataSafety'));
|
||||
const out = ctx.args.get('csv');
|
||||
if (out) { writeFileSync(resolve(out), csv); log('play', `wrote ${out}`); }
|
||||
const types = Object.keys(config.dataSafety!.data);
|
||||
log('play', `data safety: ${types.length} data types declared (${types.join(', ') || 'none'})`);
|
||||
if (ctx.args.has('dry')) { if (!out) process.stdout.write(csv); return; }
|
||||
const play = await playClient(root, need(config.play?.packageName, 'play.packageName'));
|
||||
await play.call('POST', `${play.API}/dataSafety`, { safetyLabels: csv });
|
||||
done('play', `data safety updated (${csv.split('\n').length - 2} rows)`);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue