Update Keystatic version and refactor version updater
This commit updates the Keystatic version to 0.5.23 and changes the interval for version refetching. The environment variable used for the refetch interval has been modified to NEXT_PUBLIC_VERSION_UPDATER_REFETCH_INTERVAL_SECONDS. Additionally, the code for checking for new version has been refactored and a visual change has been implemented to include a RocketIcon in the dialog header.
This commit is contained in:
@@ -33,19 +33,17 @@ function getGitHash() {
|
||||
|
||||
async function getHashFromProcess() {
|
||||
// avoid calling a Node.js command in the edge runtime
|
||||
if (process.env.NEXT_RUNTIME !== 'nodejs') {
|
||||
console.log(`[INFO] Could not find git hash in environment variables. Falling back to git command. Supply a known git hash environment variable to avoid this warning.`)
|
||||
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
||||
if (process.env.NODE_ENV !== 'development') {
|
||||
console.warn(
|
||||
`[WARN] Could not find git hash in environment variables. Falling back to git command. Supply a known git hash environment variable to avoid this warning.`,
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
const { execSync } = await import('child_process');
|
||||
|
||||
return execSync('git log --pretty=format:"%h" -n1').toString().trim();
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV !== 'development') {
|
||||
console.warn(
|
||||
`[WARN] Could not find git hash in environment variables. Falling back to git command. Supply a known git hash environment variable to avoid this warning.`,
|
||||
);
|
||||
}
|
||||
|
||||
const { execSync } = await import('child_process');
|
||||
|
||||
return execSync('git log --pretty=format:"%h" -n1').toString().trim();
|
||||
console.log(`[INFO] Could not find git hash in environment variables. Falling back to git command. Supply a known git hash environment variable to avoid this warning.`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user