migrate from scripts repo

This commit is contained in:
2026-04-19 01:04:58 +02:00
commit 486dd096f2

46
uash.ua Executable file
View File

@@ -0,0 +1,46 @@
#!/usr/bin/env uiua
┌─╴CommandLine
# "~/..." ? cwd
Pretty ↚ ⊂@~▽⊸⬚@\0≠&var"HOME"
COLORS ↚ map ⊙≡°□ ≡°⊟ [
{"red" 1} {"green" 2} {"yellow" 3} {"blue" 4}
]
ColorCode ↚ ˜⊂"\x1b[0m" ⊂$"\x1b[1;3_m"
C ↚ (
⨂{"truecolor"} □&var"COLORTERM"
⨬(ColorCode get ⊙COLORS
| ◌
)
)
PS₁ ← &pf comptime(˜⊂ C"green" " λ " C"blue" Pretty °&cd)
└─╴
┌─╴Commands
# ? {"cd" ...}
CD ← (
⨂[0 1]⊸⧻ ↘1
⨬(&cd&var"HOME"
| ⍣&cd(&ep"cd: invalid path") ⊢
| &ep"cd: too many arguments")
)
Otherwise ← (
⍣(°0&runi|&ep⊂"failed to run " /◇$"_ _")
)
└─╴
┌─╴Main
F ← |1.0 (
⊜□⊸≠@\s
⨂{"cd"}⊸⍣⊢""
⨬(Commands~CD
| Commands~Otherwise)
CommandLine~PS₁
)
CommandLine~PS₁
&rlF 0
└─╴