Pixel-Composer/scripts/shell_functions/shell_functions.gml

19 lines
674 B
Plaintext
Raw Normal View History

2023-09-28 13:15:29 +02:00
function shellOpenExplorer(path) {
var _windir = environment_get_variable("WINDIR") + "/explorer.exe";
path = string_replace_all(path, "/", "\\");
shell_execute(_windir, path);
}
function shell_execute(path, command, ref = noone) {
gml_pragma("forceinline");
var txt = $"{path} {command}";
if(global.PROC_ID == 0) noti_status(txt, THEME.noti_icon_console,, ref);
2023-09-28 13:15:29 +02:00
try {
var res = execute_shell(path, command);
if(global.PROC_ID == 0) noti_status("Execute shell complete", THEME.noti_icon_console,, ref);
2023-09-28 13:15:29 +02:00
} catch(e) {
if(global.PROC_ID == 0) noti_warning($"Execute shell failed: {e}", THEME.noti_icon_console_failed, COLORS._main_value_negative, ref);
2023-09-28 13:15:29 +02:00
}
}