mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 12:11:23 +00:00
feat: add dev update channel
This commit is contained in:
26
src/infra/update-channels.ts
Normal file
26
src/infra/update-channels.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
export type UpdateChannel = "stable" | "beta" | "dev";
|
||||
|
||||
export const DEFAULT_PACKAGE_CHANNEL: UpdateChannel = "stable";
|
||||
export const DEFAULT_GIT_CHANNEL: UpdateChannel = "dev";
|
||||
export const DEV_BRANCH = "main";
|
||||
|
||||
export function normalizeUpdateChannel(value?: string | null): UpdateChannel | null {
|
||||
if (!value) return null;
|
||||
const normalized = value.trim().toLowerCase();
|
||||
if (normalized === "stable" || normalized === "beta" || normalized === "dev") return normalized;
|
||||
return null;
|
||||
}
|
||||
|
||||
export function channelToNpmTag(channel: UpdateChannel): string {
|
||||
if (channel === "beta") return "beta";
|
||||
if (channel === "dev") return "dev";
|
||||
return "latest";
|
||||
}
|
||||
|
||||
export function isBetaTag(tag: string): boolean {
|
||||
return tag.toLowerCase().includes("-beta");
|
||||
}
|
||||
|
||||
export function isStableTag(tag: string): boolean {
|
||||
return !isBetaTag(tag);
|
||||
}
|
||||
Reference in New Issue
Block a user