1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-15 15:53:55 +00:00

Added ability to export JS modules from agent.

This commit is contained in:
Bryan Roe
2022-10-20 22:27:35 -07:00
parent 2be1bac351
commit 236786bc42
3 changed files with 170 additions and 1 deletions

View File

@@ -131,6 +131,12 @@ char* crashMemory = ILib_POSIX_InstallCrashHandler(argv[0]);
}
}
if (argc > 1 && strcmp(argv[1], "-export") == 0 && integratedJavaScriptLen == 0)
{
integratedJavaScript = ILibString_Copy("require('code-utils').expand({embedded: true});process.exit();",0);
integratedJavaScriptLen = (int)strnlen_s(integratedJavaScript, sizeof(ILibScratchPad));
}
if (argc > 2 && strcmp(argv[1], "-exec") == 0 && integratedJavaScriptLen == 0)
{
integratedJavaScript = ILibString_Copy(argv[2], 0);