mirror of https://git.kore.io/kore.git
make sure kodev run works in python modules.
This commit is contained in:
parent
3114f8d8d0
commit
574c9a7084
22
src/cli.c
22
src/cli.c
|
@ -140,6 +140,7 @@ static void fatal(const char *, ...) __attribute__((noreturn));
|
|||
|
||||
static void cli_file_close(int);
|
||||
static void cli_run_kore(void);
|
||||
static void cli_run_kore_python(void);
|
||||
static void cli_generate_certs(void);
|
||||
static void cli_compile_kore(void *);
|
||||
static void cli_link_application(void *);
|
||||
|
@ -747,6 +748,11 @@ cli_clean(int argc, char **argv)
|
|||
static void
|
||||
cli_run(int argc, char **argv)
|
||||
{
|
||||
if (cli_file_exists("__init__.py")) {
|
||||
cli_run_kore_python();
|
||||
return;
|
||||
}
|
||||
|
||||
run_after = 1;
|
||||
cli_build(argc, argv);
|
||||
|
||||
|
@ -1534,6 +1540,22 @@ cli_compile_kore(void *arg)
|
|||
fatal("failed to start '%s': %s", args[0], errno_s);
|
||||
}
|
||||
|
||||
static void
|
||||
cli_run_kore_python(void)
|
||||
{
|
||||
char *args[3], *cmd;
|
||||
|
||||
(void)cli_vasprintf(&cmd, "%s/bin/kore", prefix);
|
||||
|
||||
args[0] = cmd;
|
||||
args[1] = "-frn";
|
||||
args[2] = NULL;
|
||||
|
||||
execvp(args[0], args);
|
||||
fatal("failed to start '%s': %s", args[0], errno_s);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
cli_run_kore(void)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue