Something went wrong. Try again.
A self-hosted web platform for applications & services with design based on Google's Material 3 Expressive. (Work In Progress)
self-hosted typescript
Something went wrong. Try again.
1.2 kB · 33 lines
TypeScript
at commit 3b00a86a
12345678910111213141516171819202122232425262728293031323334import Command, { type ICommandRuntimeParameters } from "../command.ts";
export default class InstallApplicationCommand extends Command { override commandId = "application"; flags = {}; aliases = ["app"]; override shortDescription = "Enable / Disable an application";
async run(parameters: ICommandRuntimeParameters) { const targetId = parameters.arguments[0];
if (!targetId) { this.instance.log.system.warning(`Failed to find application '${targetId}' please provide a valid id`);
return this.finishRun(); }
switch (parameters.arguments[1]) { case "enable": this.instance.log.system.info(`Enabling application '${targetId}'`); await this.instance.sys.applications.enableApplication(targetId); break; case "disable": this.instance.log.system.info(`Disabling application '${targetId}'`); await this.instance.sys.applications.disableApplication(targetId); break; default: this.instance.log.system.warning(`You must provide either 'enable' or 'disable' as an action for the selected application.`); }
return this.finishRun(); }}