mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 20:59:59 +00:00
26 lines
481 B
TypeScript
26 lines
481 B
TypeScript
import { readable } from "svelte/store";
|
|
|
|
type VersionResponse = {
|
|
commit: string;
|
|
branch: string;
|
|
remote: string;
|
|
version: string;
|
|
}
|
|
|
|
const unknownVersion = {
|
|
commit: "unknown",
|
|
branch: "unknown",
|
|
remote: "unknown",
|
|
version: "unknown"
|
|
};
|
|
|
|
export const version = readable<VersionResponse>(
|
|
unknownVersion,
|
|
(set) => {
|
|
fetch('/version.json')
|
|
.then(r => r.json())
|
|
.then(set)
|
|
.catch(() => {})
|
|
}
|
|
)
|