小编Chr*_*isK的帖子

如何在 Windows 和跨平台中为 git commit 消息在 npm 脚本中传递当前日期时间?

我在 Windows 10 中工作,并尝试使用 npm 脚本进行 git commit,其中包含包含提交日期和时间的消息:

"deploy": "cd dist && git add . && git commit -m \"Release at $(date)\" && git push"
Run Code Online (Sandbox Code Playgroud)

结果 git commit 消息是

在 $(date) 发布

代替

于 03/06/2019 11:43:57 发布

我在终端中运行相同的命令时得到:

git commit -m "Release at $(date)"
Run Code Online (Sandbox Code Playgroud)

什么是跨平台解决方案?

你能解释导致不同结果的原因吗?

windows git terminal cross-platform npm-scripts

5
推荐指数
1
解决办法
2084
查看次数

标签 统计

cross-platform ×1

git ×1

npm-scripts ×1

terminal ×1

windows ×1