@pompeii-labs/cli
Version:
Magma CLI
24 lines (23 loc) • 651 B
JavaScript
import chalk from "chalk";
import { execSync } from "child_process";
async function update() {
console.log("Updating Magma CLI...");
execSync("npm install -g @pompeii-labs/cli@latest", { stdio: "inherit" });
}
function updateCommand(program) {
program.command("update").description("Update the Magma CLI to the latest published version").action(async () => {
try {
await update();
console.log(chalk.green(`
\u{1F30B} Successfully updated Magma CLI!
`));
} catch (error) {
console.error(chalk.red(`
\u274C Failed to update Magma CLI: ${error.message}`));
process.exit(1);
}
});
}
export {
updateCommand
};