Use moonbitlang/async for process and file IO

Process execution and file access go through @process and @fs. The spinner
is a background task in a task group, and the C stub keeps only getenv,
exit, isatty, symlink and stderr output. orbit info reads installed state
only, and it records and restores package descriptions. just install adds
Orbit's bin directory to ~/.bashrc once.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Haiku 5.5 committed 2026-11-26 22:40:18 -08:00
1 parent 65e5dc966f
commit ec21287549
11 files changed
+236 -213

No files matched your search

+5 -5
View File
@@ -16,7 +16,7 @@ let usage : String =
#| orbit upgrade [name...] upgrade within constraints
#| orbit rollback <name> switch to the previous build
#| orbit list installed packages
#| orbit info <name> local and remote details
#| orbit info [channel::]<name> installed package details (local only)
#| orbit versions <name> published versions
#| orbit search [term] list repositories (needs catalog API)
#| orbit gc delete unused builds from the store
@@ -30,7 +30,7 @@ let usage : String =
///|
/// Create the directories, and a config.toml if there is no config yet.
fn cmd_init() -> Unit raise OrbitError {
async fn cmd_init() -> Unit raise OrbitError {
let root = orbit_root()
sh_ok(
"mkdir -p " +
@@ -60,7 +60,7 @@ fn need(pos : Array[String], n : Int32, what : String) -> Unit raise OrbitError
}
///|
fn dispatch(args : Array[String]) -> Unit raise OrbitError {
async fn dispatch(args : Array[String]) -> Unit raise OrbitError {
if args.length() == 0 {
println(usage)
return
@@ -125,7 +125,7 @@ fn dispatch(args : Array[String]) -> Unit raise OrbitError {
}
"list" | "ls" => cmd_list(load_ctx())
"info" => {
need(pos, 1, "info <name>")
need(pos, 1, "info [channel::]<name>")
cmd_info(load_ctx(), pos[0])
}
"versions" => {
@@ -140,7 +140,7 @@ fn dispatch(args : Array[String]) -> Unit raise OrbitError {
}
///|
fn main {
async fn main {
if sh("command -v oras >/dev/null 2>&1") != 0 {
println("orbit: error: `oras` not found on PATH (https://oras.land)")
c_exit(1)