scm: clean up scm running
Split run_script / run_repl more clearly; update callers.
This commit is contained in:
@ -125,12 +125,13 @@ maybe_listen_path(const Mu::Store& store, const Mu::Options& opts)
|
||||
#ifdef BUILD_SCM
|
||||
if (!opts.scm.socket_path)
|
||||
return {};
|
||||
const auto res = Mu::Scm::run(store, opts, false/*!block*/);
|
||||
const auto socket_path{*opts.scm.socket_path};
|
||||
const auto res = Mu::Scm::run_repl(store, opts, socket_path);
|
||||
if (!res) {
|
||||
mu_warning("failed to start scm socket: {}", res.error().what());
|
||||
return {};
|
||||
} else
|
||||
return *opts.scm.socket_path;
|
||||
return socket_path;
|
||||
#endif /*BUILD_SCM*/
|
||||
return {};
|
||||
}
|
||||
|
||||
@ -73,7 +73,10 @@ cmd_scm(const Store& store, const Options& opts)
|
||||
return Err(Error::Code::InvalidArgument,
|
||||
"scm/guile is not available in this build");
|
||||
#else
|
||||
return Mu::Scm::run(store, opts, true/*blocking*/);
|
||||
if (opts.scm.script_path)
|
||||
return Mu::Scm::run_script(store, opts, *opts.scm.script_path);
|
||||
else
|
||||
return Mu::Scm::run_repl(store, opts, opts.scm.socket_path.value_or(""));
|
||||
#endif /*BUILD_SCM*/
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user