forked from cory/tildefriends
Allow importing from a single app .json.
This commit is contained in:
parent
988a807fa4
commit
4edee0f7f6
@ -230,6 +230,12 @@ static void _tf_ssb_import_app_json(tf_ssb_t* ssb, uv_loop_t* loop, JSContext* c
|
||||
}
|
||||
|
||||
void tf_ssb_import(tf_ssb_t* ssb, const char* user, const char* path)
|
||||
{
|
||||
if (strlen(path) > strlen(".json") && strcasecmp(path + strlen(path) - strlen(".json"), ".json") == 0)
|
||||
{
|
||||
_tf_ssb_import_app_json(ssb, tf_ssb_get_loop(ssb), tf_ssb_get_context(ssb), user, path);
|
||||
}
|
||||
else
|
||||
{
|
||||
uv_fs_t req = { 0 };
|
||||
int r = uv_fs_scandir(tf_ssb_get_loop(ssb), &req, path, 0, NULL);
|
||||
@ -254,6 +260,7 @@ void tf_ssb_import(tf_ssb_t* ssb, const char* user, const char* path)
|
||||
}
|
||||
uv_fs_req_cleanup(&req);
|
||||
}
|
||||
}
|
||||
|
||||
static char* _tf_ssb_import_read_current_file_from_zip(unzFile zip, size_t* size)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user