1
mirror of https://github.com/flipperdevices/flipperzero-firmware.git synced 2025-12-12 04:41:26 +04:00

JS CLI command (#3539)

* js command
* made the js command exit when there's an error
* JS CLI: moved to js_app
* JS: abortable cli invocations
* JS: less debug logging in console logs, fix storage descriptor leak in cli

Co-authored-by: Milk-Cool <milan-pl@mail.ru>
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov
2024-03-25 19:35:38 +03:00
committed by GitHub
parent bb439a9761
commit 84beb9b23e
5 changed files with 98 additions and 4 deletions

View File

@@ -44,12 +44,12 @@ static void js_print(struct mjs* mjs) {
FuriString* msg_str = furi_string_alloc();
js_str_print(msg_str, mjs);
printf("%s\r\n", furi_string_get_cstr(msg_str));
JsThread* worker = mjs_get_context(mjs);
furi_assert(worker);
if(worker->app_callback) {
worker->app_callback(JsThreadEventPrint, furi_string_get_cstr(msg_str), worker->context);
} else {
FURI_LOG_D(TAG, "%s\r\n", furi_string_get_cstr(msg_str));
}
furi_string_free(msg_str);