From 63ae186c76cdfd3462a3f21fc72a26cf0e5bd2ee Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 24 Feb 2024 10:55:09 -0500 Subject: [PATCH] Export app json files indented with tabs. --- apps/admin.json | 4 ++-- apps/api.json | 6 +++--- apps/apps.json | 6 +++--- apps/db.json | 4 ++-- apps/follow.json | 4 ++-- apps/ssb.json | 6 +++--- apps/todo.json | 4 ++-- src/ssb.export.c | 4 +++- 8 files changed, 20 insertions(+), 18 deletions(-) diff --git a/apps/admin.json b/apps/admin.json index 711779a2..cfec74e1 100644 --- a/apps/admin.json +++ b/apps/admin.json @@ -1,4 +1,4 @@ { - "type": "tildefriends-app", - "emoji": "🎛" + "type": "tildefriends-app", + "emoji": "🎛" } \ No newline at end of file diff --git a/apps/api.json b/apps/api.json index 2e226336..130dcc43 100644 --- a/apps/api.json +++ b/apps/api.json @@ -1,5 +1,5 @@ { - "type": "tildefriends-app", - "emoji": "📜", - "previous": "&miGORZ8BwjHg2YO0t4bms6SI28XWPYqnqOZ8u9zsbZc=.sha256" + "type": "tildefriends-app", + "emoji": "📜", + "previous": "&miGORZ8BwjHg2YO0t4bms6SI28XWPYqnqOZ8u9zsbZc=.sha256" } \ No newline at end of file diff --git a/apps/apps.json b/apps/apps.json index 7b0370a0..8b67c693 100644 --- a/apps/apps.json +++ b/apps/apps.json @@ -1,5 +1,5 @@ { - "type": "tildefriends-app", - "emoji": "💻", - "previous": "&RdVEsVscZm3aWzcMrEZS8mskO5tUmvaEUihex2MMfZQ=.sha256" + "type": "tildefriends-app", + "emoji": "💻", + "previous": "&RdVEsVscZm3aWzcMrEZS8mskO5tUmvaEUihex2MMfZQ=.sha256" } \ No newline at end of file diff --git a/apps/db.json b/apps/db.json index 3a02f75d..9dbdad9c 100644 --- a/apps/db.json +++ b/apps/db.json @@ -1,4 +1,4 @@ { - "type": "tildefriends-app", - "emoji": "💽" + "type": "tildefriends-app", + "emoji": "💽" } \ No newline at end of file diff --git a/apps/follow.json b/apps/follow.json index 5e137e35..b9466f16 100644 --- a/apps/follow.json +++ b/apps/follow.json @@ -1,4 +1,4 @@ { - "type": "tildefriends-app", - "emoji": "➡️" + "type": "tildefriends-app", + "emoji": "➡️" } \ No newline at end of file diff --git a/apps/ssb.json b/apps/ssb.json index 6466712c..61bd4d2d 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { - "type": "tildefriends-app", - "emoji": "🐌", - "previous": "&DUxMMCJcuhm6S9jg/eKgEyWodkITu6Tg9g5I5wgLWFU=.sha256" + "type": "tildefriends-app", + "emoji": "🐌", + "previous": "&DUxMMCJcuhm6S9jg/eKgEyWodkITu6Tg9g5I5wgLWFU=.sha256" } \ No newline at end of file diff --git a/apps/todo.json b/apps/todo.json index 10dd5d8d..df0f86fc 100644 --- a/apps/todo.json +++ b/apps/todo.json @@ -1,4 +1,4 @@ { - "type": "tildefriends-app", - "emoji": "☑️" + "type": "tildefriends-app", + "emoji": "☑️" } \ No newline at end of file diff --git a/src/ssb.export.c b/src/ssb.export.c index d751dcc0..2d7a2c87 100644 --- a/src/ssb.export.c +++ b/src/ssb.export.c @@ -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);