Skip to content

Commit 131b1f8

Browse files
committed
fix the husky
1 parent 34c2538 commit 131b1f8

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
node scripts/write-commit-time.mjs
52
npx --no-install lint-staged

client/src/commit_time.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2026-01-14T20:39:24.588Z
1+
2026-01-14T20:41:29.540Z

client/src/vite-env.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/// <reference types="vite/client" />
2+
3+
declare module '*.txt?raw' {
4+
const content: string;
5+
export default content;
6+
}
7+

scripts/write-commit-time.mjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import fs from 'node:fs/promises';
2+
import path from 'node:path';
3+
import { execFileSync } from 'node:child_process';
4+
5+
const repoRoot = process.cwd();
6+
const commitTimeFile = path.join(repoRoot, 'client', 'src', 'commit_time.txt');
7+
8+
const commitTimeUtcIso = new Date().toISOString();
9+
await fs.mkdir(path.dirname(commitTimeFile), { recursive: true });
10+
await fs.writeFile(commitTimeFile, `${commitTimeUtcIso}\n`, 'utf8');
11+
12+
// Ensure the updated timestamp is included in the commit.
13+
execFileSync('git', ['add', commitTimeFile], { stdio: 'inherit' });
14+

0 commit comments

Comments
 (0)