Skip to content

Commit

Permalink
Merge pull request #154 from chillcicada/master
Browse files Browse the repository at this point in the history
fix: 'date' cli doesn't work on Windows
  • Loading branch information
Harry-Chen committed Mar 29, 2024
2 parents 3b0e926 + 50e3165 commit c71677e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const isDev = process.env.NODE_ENV === 'development';
const helperVersion = version;
const gitVersion = runCmd('git describe --always --dirty');
const gitBranch = runCmd('git branch --show-current');
const date = new Date();

// https://vitejs.dev/config/
export default defineConfig({
Expand All @@ -37,7 +38,7 @@ export default defineConfig({
),
__GIT_BRANCH__: JSON.stringify(runCmd('git rev-parse --abbrev-ref HEAD')),
__BUILD_HOSTNAME__: JSON.stringify(runCmd('hostname')),
__BUILD_TIME__: JSON.stringify(runCmd('date +"%Y/%m/%d %T"')),
__BUILD_TIME__: JSON.stringify(`date + ${date.toLocaleString('zh-CN')}`),
__THU_LEARN_LIB_VERSION__: JSON.stringify(versionThuLearnLib),
__MUI_VERSION__: JSON.stringify(versionMui),
__REACT_VERSION__: JSON.stringify(versionReact),
Expand Down

0 comments on commit c71677e

Please sign in to comment.