#!/usr/bin/env node
/**
 * TFDS 版本更新检测（只读）
 *   node node_modules/@tfdesign/b-end/scripts/check-tfds-update.mjs
 */
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { runTfdsUpdateCheck } from './lib/check-tfds-update-core.mjs';

const pkgRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');

runTfdsUpdateCheck({
  pkgRoot,
  setupCommand: 'npx -y -p @tfdesign/b-end@latest tfds-b-end-setup',
}).catch((error) => {
  console.log('\n[tfds-update-check] 更新检测脚本异常退出。');
  console.log(`  错误：${error?.message || error}\n`);
  process.exit(1);
});
