mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
* TODO: images * wip * pack s9pk images * include path in packsource error * debug info * add cmd as context to invoke * filehelper bugfix * fix file helper * fix exposeForDependents * misc fixes * force image removal * fix filtering * fix deadlock * fix api * chore: Up the version of the package.json * always allow concurrency within same call stack * Update core/startos/src/s9pk/merkle_archive/expected.rs Co-authored-by: Jade <2364004+Blu-J@users.noreply.github.com> --------- Co-authored-by: J H <dragondef@gmail.com> Co-authored-by: Jade <2364004+Blu-J@users.noreply.github.com>
23 lines
630 B
TypeScript
23 lines
630 B
TypeScript
import * as fs from "node:fs/promises"
|
|
import { System } from "../../Interfaces/System"
|
|
import { EMBASSY_JS_LOCATION, SystemForEmbassy } from "./SystemForEmbassy"
|
|
import { STARTOS_JS_LOCATION, SystemForStartOs } from "./SystemForStartOs"
|
|
export async function getSystem(): Promise<System> {
|
|
if (
|
|
await fs.access(STARTOS_JS_LOCATION).then(
|
|
() => true,
|
|
() => false,
|
|
)
|
|
) {
|
|
return SystemForStartOs.of()
|
|
} else if (
|
|
await fs.access(EMBASSY_JS_LOCATION).then(
|
|
() => true,
|
|
() => false,
|
|
)
|
|
) {
|
|
return SystemForEmbassy.of()
|
|
}
|
|
throw new Error(`${STARTOS_JS_LOCATION} not found`)
|
|
}
|