Desktop: adapt to 0.5.0 (app.platforms, subscriptions, catalog diff), Dependencies polish, ~ for the home folder
- inspect reports platforms, subscription ids and the catalog each store should sell; app identity and parity follow app.platforms and per-item platforms; catalog.diff joins the JSON methods - Portfolio: one Platforms column, compact catalog, paths truncated and shown with ~; the confirm dialog and run logs show ~ instead of the home folder
This commit is contained in:
parent
7fab0a5b03
commit
9320d64f46
12 changed files with 60 additions and 24 deletions
|
|
@ -9,7 +9,7 @@ import { appleCurrent, pages, playProduct } from './prices';
|
|||
import { ascClient, type J } from './apple/asc';
|
||||
import { type CatalogRow, catalogDiff, fromApplePeriod, fromAppleType, regionOf, type StoreItem, wantedCatalog } from './lib/catalog';
|
||||
import type { Ctx } from './lib/ctx';
|
||||
import { done, log } from './lib/log';
|
||||
import { done, log, printJson } from './lib/log';
|
||||
import { fromMoney } from './lib/money';
|
||||
import { listOneTimeProducts } from './play/products';
|
||||
import { playClient } from './play/client';
|
||||
|
|
@ -94,7 +94,7 @@ export async function run(ctx: Ctx): Promise<void> {
|
|||
const play = (!store || store === 'play') && config.play ? await playItems(ctx) : null;
|
||||
const { rows, parity } = catalogDiff(want, { apple, play }, { threshold: a.num('threshold', 10) / 100 });
|
||||
const errors = rows.filter(r => r.level === 'error').length;
|
||||
if (a.has('json')) console.log(JSON.stringify({ errors, rows, parity }, null, 2));
|
||||
if (a.has('json')) printJson({ errors, rows, parity });
|
||||
else {
|
||||
console.log(formatRows(rows));
|
||||
if (parity.length) console.log(`\nprice differences between the stores (same currency, over ${a.num('threshold', 10)} %):\n` +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue