Initial upload with CI/CD workflow
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-02-05 19:31:42 +00:00
parent 8f1a5aa88f
commit 5a00548f6f

48
src/commands/delete.ts Normal file
View File

@@ -0,0 +1,48 @@
import inquirer from 'inquirer';
import { fileUtils } from '../utils/fileUtils';
interface DeleteOptions {
name: string;
force?: boolean;
}
export async function deleteLayout(options: DeleteOptions): Promise<void> {
await fileUtils.initialize();
let layoutName = options.name;
if (!layoutName) {
const layouts = await fileUtils.listLayouts();
if (layouts.length === 0) {
throw new Error('No layouts found.');
}
const { selectedLayout } = await inquirer.prompt([
{
type: 'list',
name: 'selectedLayout',
message: 'Select a layout to delete:',
choices: layouts,
},
]);
layoutName = selectedLayout;
}
if (!options.force) {
const { confirm } = await inquirer.prompt([
{
type: 'confirm',
name: 'confirm',
message: `Delete layout "${layoutName}"?`,
default: false,
},
]);
if (!confirm) {
console.log('Deletion cancelled.');
return;
}
}
await fileUtils.deleteLayout(layoutName);
console.log(`Layout deleted: ${layoutName}`);
}