mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
Merge branch 'open-webui:main' into web_search_optional_fields
This commit is contained in:
commit
897727c7eb
@ -1,6 +1,7 @@
|
||||
import adapter from '@sveltejs/adapter-static';
|
||||
import * as child_process from 'node:child_process';
|
||||
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||
import fs from 'node:fs';
|
||||
|
||||
/** @type {import('@sveltejs/kit').Config} */
|
||||
const config = {
|
||||
@ -18,7 +19,22 @@ const config = {
|
||||
}),
|
||||
// poll for new version name every 60 seconds (to trigger reload mechanic in +layout.svelte)
|
||||
version: {
|
||||
name: child_process.execSync('git rev-parse HEAD').toString().trim(),
|
||||
name: (() => {
|
||||
try {
|
||||
return child_process.execSync('git rev-parse HEAD').toString().trim();
|
||||
} catch {
|
||||
// if git is not available, fallback to package.json version
|
||||
// or current timestamp
|
||||
try {
|
||||
return (
|
||||
JSON.parse(fs.readFileSync(new URL('./package.json', import.meta.url), 'utf8'))
|
||||
?.version || Date.now().toString()
|
||||
);
|
||||
} catch {
|
||||
return Date.now().toString();
|
||||
}
|
||||
}
|
||||
})(),
|
||||
pollInterval: 60000
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user