Use op-cli-installed as local package

This commit is contained in:
Volodymyr Zotov
2025-12-15 13:45:09 -06:00
parent c96389a7ae
commit 2f243ca4fa
25 changed files with 1894 additions and 3268 deletions

View File

@@ -0,0 +1,23 @@
import os from "os";
import { LinuxInstaller } from "./linux";
import { MacOsInstaller } from "./macos";
import { WindowsInstaller } from "./windows";
export interface Installer {
installCli(): Promise<void>;
}
export const newCliInstaller = (version: string): Installer => {
const platform = os.platform();
switch (platform) {
case "linux":
return new LinuxInstaller(version);
case "darwin":
return new MacOsInstaller(version);
case "win32":
return new WindowsInstaller(version);
default:
throw new Error(`Unsupported platform: ${platform}`);
}
};