Skip to content

Commit

Permalink
chore: expose git commit hash for debug purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
ajitid committed Jul 21, 2021
1 parent 5b9d6d3 commit 6932041
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
11 changes: 10 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"prism-react-renderer": "^1.2.1",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"react-git-info": "^2.0.0",
"react-router": "^6.0.0-beta.0",
"react-router-dom": "^6.0.0-beta.0",
"shelljs": "^0.8.4",
Expand Down
3 changes: 3 additions & 0 deletions src/utils/expose.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import GitInfo from "react-git-info/macro";
import { version as newestVersion } from "../../package.json";

function loadScript(
Expand All @@ -22,6 +23,8 @@ export const expose = (version = "") => {
};

if (import.meta.env.PROD) {
const gitInfo = GitInfo();
console.log("on commit", gitInfo.commit.hash);
console.log(
'%cFZF\n%cTo use FZF here type, `init()` or `init("' +
newestVersion +
Expand Down

0 comments on commit 6932041

Please sign in to comment.