kawkab-frontend
Version:
Kawkab frontend is a frontend library for the Kawkab framework
21 lines (20 loc) ⢠789 B
JavaScript
import chalk from 'chalk';
import { detectPackageManager, run } from '../utils/helpers.js';
export function syncCommand(program) {
program
.command('sync')
.description('Sync web assets with native mobile platforms (Capacitor).')
.action(() => {
console.log(chalk.blue('š Syncing web build with native platforms...'));
try {
const packageManager = detectPackageManager();
const capCmd = packageManager === 'bun' ? 'bun cap' : 'npx cap';
run(`${capCmd} sync`);
console.log(chalk.green('ā
Sync complete!'));
}
catch (error) {
console.error(chalk.red('\nā Sync failed. Did you run the static build first?'), error);
process.exit(1);
}
});
}