fix: footer date in edgeone without cloudflare env
This commit is contained in:
17
scripts/git.ts
Normal file
17
scripts/git.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { simpleGit } from 'simple-git'
|
||||
|
||||
const git = simpleGit()
|
||||
|
||||
/**
|
||||
* get git repo latest commit
|
||||
*/
|
||||
export async function getLatestCommit() {
|
||||
try {
|
||||
const log = await git.log({ maxCount: 1 })
|
||||
return log.latest
|
||||
}
|
||||
catch (error) {
|
||||
console.error('Error fetching latest commit:', error)
|
||||
return null
|
||||
}
|
||||
}
|
||||
@@ -3,5 +3,8 @@
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"convert": "tsx convert.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"simple-git": "^3.28.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user