Import stock apps into /~core/ at launch. Makes the first time experience vaguely work with only running and clicking in the web interface.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3774 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2022-01-17 22:00:42 +00:00
parent c864041fa0
commit 0b5017b208
4 changed files with 9 additions and 1 deletions

View File

@ -11,7 +11,7 @@ var gProcesses = {};
var gSessionIndex = 0;
var gGlobalSettings = {
index: "/~cory/index",
index: "/~core/index",
};
var kGlobalSettingsFile = "data/global/settings.json";

View File

@ -341,6 +341,7 @@ static int _tf_run_task(const tf_run_args_t* args, int index)
tf_task_set_db_path(task, db_path);
tf_task_set_secrets_path(task, secrets_path);
tf_task_activate(task);
tf_ssb_import(tf_task_get_ssb(task), "core", "apps");
if (tf_task_execute(task, args->script))
{
tf_task_run(task);

View File

@ -1407,6 +1407,11 @@ JSContext* tf_task_get_context(tf_task_t* task)
return task->_context;
}
tf_ssb_t* tf_task_get_ssb(tf_task_t* task)
{
return task->_ssb;
}
static void _tf_task_on_handle_close(uv_handle_t* handle)
{
handle->data = NULL;

View File

@ -14,6 +14,7 @@ typedef int exportid_t;
typedef struct _tf_taskstub_t tf_taskstub_t;
typedef struct _tf_task_t tf_task_t;
typedef struct _tf_trace_t tf_trace_t;
typedef struct _tf_ssb_t tf_ssb_t;
static const taskid_t k_task_parent_id = 0;
@ -53,6 +54,7 @@ JSValue tf_task_add_import(tf_task_t* task, taskid_t stub_id, exportid_t export_
uv_loop_t* tf_task_get_loop(tf_task_t* task);
tf_task_t* tf_task_get(JSContext* context);
tf_trace_t* tf_task_get_trace(tf_task_t* task);
tf_ssb_t* tf_task_get_ssb(tf_task_t* task);
void tf_task_run_jobs(tf_task_t* task);
const char* tf_task_get_name(tf_task_t* task);