Skip to content
Snippets Groups Projects
Commit b9e636d3 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 5aff97c5
No related branches found
No related tags found
No related merge requests found
......@@ -46,8 +46,23 @@ tree.colors.lfg = WHITE;
tree.colors.lbg = BG_CYAN;
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;
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';
if (!file_exists(ini)) return;
const f = new File(ini);
......@@ -73,6 +88,11 @@ directory(system.exec_dir + '../xtrn/*', GLOB_ONLYDIR).forEach(function (e) {
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;
info_frame.x = 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.
Finish editing this message first!
Please register or to comment