Enhance installation and update processes with user confirmation and GPU detection; add required packages

This commit is contained in:
2026-07-05 23:25:37 +02:00
parent 93de248c5a
commit db651dff28
5 changed files with 86 additions and 32 deletions
+22 -14
View File
@@ -3,20 +3,28 @@ import { install } from "./install.js";
import { update } from "./update.js";
import { remove } from "./remove.js";
const { positionals } = parseArgs({ allowPositionals: true });
const { positionals, values } = parseArgs({
allowPositionals: true,
options: { yes: { type: "boolean", short: "y", default: false } },
});
const [command] = positionals;
switch (command) {
case "install":
await install();
break;
case "update":
await update();
break;
case "remove":
await remove();
break;
default:
console.error("Usage: dotfiles <install|update|remove>");
process.exit(1);
try {
switch (command) {
case "install":
await install({ yes: values.yes });
break;
case "update":
await update({ yes: values.yes });
break;
case "remove":
await remove();
break;
default:
console.error("Usage: dotfiles <install|update|remove> [-y|--yes]");
process.exit(1);
}
} catch (err) {
console.error(`\nError: ${(err as Error).message}`);
process.exit(1);
}