-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
45 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ description = "Default template for PDM package" | |
authors = [ | ||
{name = "svtter", email = "[email protected]"}, | ||
] | ||
dependencies = [] | ||
dependencies = ["loguru>=0.7.2"] | ||
requires-python = ">=3.9" | ||
readme = "README.md" | ||
license = {text = "MIT"} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.2.0" | ||
__version__ = "0.2.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
import os | ||
|
||
from loguru import logger | ||
|
||
|
||
def check_clean(folder: str = "."): | ||
# 检查git仓库是否有未提交的更改 | ||
os.chdir(folder) | ||
result = os.popen("git status --porcelain").read() | ||
if not os.path.exists(".git"): | ||
print("错误: 当前目录不是git仓库") | ||
logger.error("错误: 当前目录不是git仓库") | ||
exit(1) | ||
if result: | ||
print("错误: git仓库不干净,请先提交所有更改") | ||
print("未提交的更改:") | ||
print(result) | ||
logger.error("错误: git仓库不干净,请先提交所有更改") | ||
logger.error("未提交的更改:") | ||
logger.error(result) | ||
exit(1) | ||
print("git仓库状态检查通过") | ||
logger.info("git仓库状态检查通过") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters