Update package versions and improve code handling
Multiple package versions have been updated to their latest versions for better compatibility and stability. In addition, modifications were made to the `getGitHash` function in `route.ts` to handle potential failures more gracefully.
This commit is contained in:
@@ -21,14 +21,20 @@ export const GET = async () => {
|
||||
});
|
||||
};
|
||||
|
||||
function getGitHash() {
|
||||
async function getGitHash() {
|
||||
for (const envVar of KNOWN_GIT_ENV_VARS) {
|
||||
if (process.env[envVar]) {
|
||||
return process.env[envVar];
|
||||
}
|
||||
}
|
||||
|
||||
return getHashFromProcess();
|
||||
try {
|
||||
return await getHashFromProcess();
|
||||
} catch (error) {
|
||||
console.warn(`[WARN] Could not find git hash: ${JSON.stringify(error)}. You may want to provide a fallback.`);
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
async function getHashFromProcess() {
|
||||
|
||||
Reference in New Issue
Block a user