Skip to content

Commit

Permalink
Merge pull request ChatGPTNextWeb#68 from AprilNEA/main
Browse files Browse the repository at this point in the history
fix(ChatGPTNextWeb#65): fix unknown git commit id
  • Loading branch information
Yidadaa authored Mar 27, 2023
2 parents 15cc890 + 06ba3f5 commit 2266988
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
};

Expand Down

0 comments on commit 2266988

Please sign in to comment.