Export app json files indented with tabs.

This commit is contained in:
Cory McWilliams 2024-02-24 10:55:09 -05:00
parent 2701b7d04e
commit 63ae186c76
8 changed files with 20 additions and 18 deletions

View File

@ -1,4 +1,4 @@
{
"type": "tildefriends-app",
"emoji": "🎛"
"type": "tildefriends-app",
"emoji": "🎛"
}

View File

@ -1,5 +1,5 @@
{
"type": "tildefriends-app",
"emoji": "📜",
"previous": "&miGORZ8BwjHg2YO0t4bms6SI28XWPYqnqOZ8u9zsbZc=.sha256"
"type": "tildefriends-app",
"emoji": "📜",
"previous": "&miGORZ8BwjHg2YO0t4bms6SI28XWPYqnqOZ8u9zsbZc=.sha256"
}

View File

@ -1,5 +1,5 @@
{
"type": "tildefriends-app",
"emoji": "💻",
"previous": "&RdVEsVscZm3aWzcMrEZS8mskO5tUmvaEUihex2MMfZQ=.sha256"
"type": "tildefriends-app",
"emoji": "💻",
"previous": "&RdVEsVscZm3aWzcMrEZS8mskO5tUmvaEUihex2MMfZQ=.sha256"
}

View File

@ -1,4 +1,4 @@
{
"type": "tildefriends-app",
"emoji": "💽"
"type": "tildefriends-app",
"emoji": "💽"
}

View File

@ -1,4 +1,4 @@
{
"type": "tildefriends-app",
"emoji": "➡️"
"type": "tildefriends-app",
"emoji": "➡️"
}

View File

@ -1,5 +1,5 @@
{
"type": "tildefriends-app",
"emoji": "🐌",
"previous": "&DUxMMCJcuhm6S9jg/eKgEyWodkITu6Tg9g5I5wgLWFU=.sha256"
"type": "tildefriends-app",
"emoji": "🐌",
"previous": "&DUxMMCJcuhm6S9jg/eKgEyWodkITu6Tg9g5I5wgLWFU=.sha256"
}

View File

@ -1,4 +1,4 @@
{
"type": "tildefriends-app",
"emoji": "☑️"
"type": "tildefriends-app",
"emoji": "☑️"
}

View File

@ -171,7 +171,9 @@ void tf_ssb_export(tf_ssb_t* ssb, const char* key)
JS_DeleteProperty(context, app, files_atom, 0);
JS_FreeAtom(context, files_atom);
JSValue json = JS_JSONStringify(context, app, JS_NULL, JS_NewInt32(context, 2));
JSValue tab = JS_NewString(context, "\t");
JSValue json = JS_JSONStringify(context, app, JS_NULL, tab);
JS_FreeValue(context, tab);
size_t length = 0;
const char* string = JS_ToCStringLen(context, &length, json);
snprintf(file_path, sizeof(file_path), "apps/%s.json", path);