updates
CI / test (push) Failing after 4m56s

This commit is contained in:
Raven Scott
2026-04-02 22:35:09 -04:00
parent efeee0088a
commit 2e26b14250
56 changed files with 1838 additions and 75 deletions
+37
View File
@@ -0,0 +1,37 @@
/** Shared helpers for drive-resident /bin scripts (prepended before each command). */
function bareStdin(ctx) {
return typeof ctx.shellStdin === 'string' ? ctx.shellStdin : ''
}
async function run(ctx, argv) {
const flagArgs = argv.slice(1).filter((a) => a.startsWith('-') && a !== '--')
const all = argv.includes('-a')
const noFlag = flagArgs.length === 0
const wantS = all || argv.includes('-s') || noFlag
const wantN = all || argv.includes('-n')
const wantR = all || argv.includes('-r')
const wantM = all || argv.includes('-m')
const wantV = all || argv.includes('-v')
let name = 'BareOS'
let version = '0.1'
const buf = await ctx.vfs.readFile('/etc/os-release')
if (buf) {
const t = ctx.b4a.toString(buf)
for (const line of t.split('\n')) {
const id = line.match(/^NAME=(.*)$/)
if (id) name = id[1].replace(/^"|"$/g, '')
const ver = line.match(/^VERSION=(.*)$/)
if (ver) version = ver[1].replace(/^"|"$/g, '')
}
}
const parts = []
if (wantS) parts.push(name)
if (wantN) parts.push('bare-os')
if (wantR) parts.push(version)
if (wantV) parts.push('bare-userland')
if (wantM) parts.push('unknown')
ctx.console.log(parts.join(' '))
}