Skip to content

Commit 1cbdec4

Browse files
committed
Auto-generated summary:
Commit Date: File changes: auto_commit.sh | 13 +++++++------ pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-)
1 parent 67d4562 commit 1cbdec4

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

auto_commit.sh

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/bin/bash
2-
# 获取当前时间戳
2+
# 获取当前本地时间戳
33
timestamp=$(date +"%Y%m%d%H%M%S")
4-
5-
# 从 pyproject.toml 中提取版本号,并添加当前时间戳
6-
old_version=$(sed -n 's/version = "\(.*\)"/\1/p' pyproject.toml)
7-
new_version=$(echo ${old_version} | sed "s/\([0-9]\{12\}\)$/$(date +"%Y%m%d%H%M%S")/")
8-
4+
# 从 pyproject.toml 中提取并更新版本号
5+
old_version=$(sed -n 's/version = "\([0-9\.]*\)"/\1/p' pyproject.toml)
6+
old_version_length=$(echo -n "$old_version" | wc -c)
7+
timestamp_length=$(echo -n "$timestamp" | wc -c)
8+
version_prefix=0.0.
9+
new_version="${version_prefix}${timestamp}"
910
# 替换 pyproject.toml 中的版本号
1011
sed -i '' -e "s/version = \".*\"/version = \"$new_version\"/" pyproject.toml
1112

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pdf_regenerator"
3-
version = "0.0.2020240308181522"
3+
version = "0.0.20240308182113"
44
authors = [{name="Talbot3",email="[email protected]"}]
55
description = "PDF Regenerator是一款开源辅助阅读工具,可帮助重新生成 有辅助信息的PDF 文件。"
66
readme = "README.md"

0 commit comments

Comments
 (0)