Skip to content
Snippets Groups Projects
Commit 5038e235 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Skip already-installed externals and fail w/msg if no installables were found.

parent de3ac144
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -46,8 +46,23 @@ tree.colors.lfg = WHITE; ...@@ -46,8 +46,23 @@ tree.colors.lfg = WHITE;
tree.colors.lbg = BG_CYAN; tree.colors.lbg = BG_CYAN;
tree.colors.kfg = LIGHTCYAN; tree.colors.kfg = LIGHTCYAN;
function find_startup_dir(dir)
{
for (var i in xtrn_area.prog) {
if (!xtrn_area.prog[i].startup_dir)
continue;
var path = backslash(fullpath(xtrn_area.prog[i].startup_dir));
if (path == dir)
return i;
}
return false;
}
var longest = 0; var longest = 0;
directory(system.exec_dir + '../xtrn/*', GLOB_ONLYDIR).forEach(function (e) { directory(system.exec_dir + '../xtrn/*', GLOB_ONLYDIR).forEach(function (e) {
var dir = backslash(fullpath(e));
if (find_startup_dir(dir) !== false)
return;
const ini = e + '/install-xtrn.ini'; const ini = e + '/install-xtrn.ini';
if (!file_exists(ini)) return; if (!file_exists(ini)) return;
const f = new File(ini); const f = new File(ini);
...@@ -73,6 +88,11 @@ directory(system.exec_dir + '../xtrn/*', GLOB_ONLYDIR).forEach(function (e) { ...@@ -73,6 +88,11 @@ directory(system.exec_dir + '../xtrn/*', GLOB_ONLYDIR).forEach(function (e) {
if (xtrn.Name.length > longest) longest = xtrn.Name.length; if (xtrn.Name.length > longest) longest = xtrn.Name.length;
}); });
if (!tree.items.length) {
alert("No installable external programs found");
exit(0);
}
tree_frame.width = longest + 1; tree_frame.width = longest + 1;
info_frame.x = tree_frame.width + 2; info_frame.x = tree_frame.width + 2;
info_frame.width = main_frame.width - tree_frame.width - 2; info_frame.width = main_frame.width - tree_frame.width - 2;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment