1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-27 13:43:17 +00:00

1. Changed Array.includes polyfill to be nonenumerable, fixing potential problems when using for loops

2. Added uninstall helper
3. Fixed macOS bug on 'load' function
This commit is contained in:
Bryan Roe
2020-02-25 23:32:21 -08:00
parent 7c77677b3e
commit 6f5f065eb5
5 changed files with 68 additions and 23 deletions

View File

@@ -3883,6 +3883,10 @@ int MeshAgent_AgentMode(MeshAgentHostContainer *agentHost, int paramLen, char **
{
installFlag = 1;
}
if (strcmp("-funinstall", param[ri]) == 0)
{
installFlag = 2;
}
}
paramLen -= ixr;
if (installFlag != 0)
@@ -3917,10 +3921,23 @@ int MeshAgent_AgentMode(MeshAgentHostContainer *agentHost, int paramLen, char **
}
}
duk_pop(ctxx);
ILibMemory_Free(buf);
return(1);
break;
case 2:
duk_eval_string(ctxx, "require('agent-installer');");
duk_get_prop_string(ctxx, -1, "fullUninstall");
duk_swap_top(ctxx, -2);
if (duk_pcall_method(ctxx, 0) != 0)
{
if (strcmp(duk_safe_to_string(ctxx, -1), "Process.exit() forced script termination") != 0)
{
printf("%s\n", duk_safe_to_string(ctxx, -1));
}
}
duk_pop(ctxx);
return(1);
break;
default:
break;
}