🗑️ ags(scripts/utils): remove unnecessary getUserDirs() method
use GLib methods instead
This commit is contained in:
+1
-11
@@ -9,16 +9,6 @@ export function getHyprlandVersion(): string {
|
|||||||
return exec(`${GLib.getenv("HYPRLAND_CMD") || "Hyprland"} --version | head -n1`).split(" ")[1];
|
return exec(`${GLib.getenv("HYPRLAND_CMD") || "Hyprland"} --version | head -n1`).split(" ")[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUserDirs() {
|
|
||||||
return {
|
|
||||||
home: GLib.get_home_dir(),
|
|
||||||
state: GLib.get_user_state_dir(),
|
|
||||||
cache: GLib.get_user_cache_dir(),
|
|
||||||
config: GLib.get_user_config_dir(),
|
|
||||||
data: GLib.get_user_data_dir()
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function makeDirectory(dir: string): void {
|
export function makeDirectory(dir: string): void {
|
||||||
execAsync([ "mkdir", "-p", dir ]);
|
execAsync([ "mkdir", "-p", dir ]);
|
||||||
}
|
}
|
||||||
@@ -28,7 +18,7 @@ export function deleteFile(path: string): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isInstalled(commandName: string): boolean {
|
export function isInstalled(commandName: string): boolean {
|
||||||
const output = exec(["command", "-v", commandName]);
|
const output = exec(["bash", "-c", `command -v ${commandName}`]);
|
||||||
if(output)
|
if(output)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user