mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2024-11-27 08:53:17 +08:00
Merge pull request #68 from AprilNEA/main
fix(#65): fix unknown git commit id
This commit is contained in:
commit
60f27fdfbb
@ -5,10 +5,15 @@ import "./styles/prism.scss";
|
||||
import process from "child_process";
|
||||
import { ACCESS_CODES } from "./api/access";
|
||||
|
||||
const COMMIT_ID = process
|
||||
.execSync("git rev-parse --short HEAD")
|
||||
.toString()
|
||||
.trim();
|
||||
let COMMIT_ID: string | undefined;
|
||||
try {
|
||||
COMMIT_ID = process
|
||||
.execSync("git rev-parse --short HEAD")
|
||||
.toString()
|
||||
.trim();
|
||||
} catch (e) {
|
||||
console.error("No git or not from git repo.")
|
||||
}
|
||||
|
||||
export const metadata = {
|
||||
title: "ChatGPT Next Web",
|
||||
@ -22,7 +27,7 @@ export const metadata = {
|
||||
|
||||
function Meta() {
|
||||
const metas = {
|
||||
version: COMMIT_ID,
|
||||
version: COMMIT_ID ?? "unknown",
|
||||
access: ACCESS_CODES.size > 0 ? "enabled" : "disabled",
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user