mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
* fixes for main * refactor package initialization * fixes from testing * more fixes * beta.21 * do not use instanceof * closes #2921 * beta22 * allow disabling kiosk * migration * fix /etc/shadow * actionRequest -> task * beta.23
26 lines
696 B
TypeScript
26 lines
696 B
TypeScript
import { ExtendedVersion, VersionRange } from "../../../base/lib/exver"
|
|
import * as T from "../../../base/lib/types"
|
|
|
|
export type UninitFn = (
|
|
effects: T.Effects,
|
|
target: VersionRange | ExtendedVersion | null,
|
|
) => Promise<void | null | undefined>
|
|
|
|
export interface UninitScript {
|
|
uninit(
|
|
effects: T.Effects,
|
|
target: VersionRange | ExtendedVersion | null,
|
|
): Promise<void>
|
|
}
|
|
|
|
export function setupUninit(
|
|
...uninits: (UninitScript | UninitFn)[]
|
|
): T.ExpectedExports.uninit {
|
|
return async (opts) => {
|
|
for (const uninit of uninits) {
|
|
if ("uninit" in uninit) await uninit.uninit(opts.effects, opts.target)
|
|
else await uninit(opts.effects, opts.target)
|
|
}
|
|
}
|
|
}
|