✨ ags(scripts/utils): add a function to check if an app is installed
This commit is contained in:
@@ -26,3 +26,11 @@ export function makeDirectory(dir: string): void {
|
||||
export function deleteFile(path: string): void {
|
||||
execAsync([ "rm", "-r", path ]);
|
||||
}
|
||||
|
||||
export function isInstalled(commandName: string): boolean {
|
||||
const output = exec(["command", "-v", commandName]);
|
||||
if(output)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user