Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 820ada2

Browse files
crai0Lee-W
authored andcommitted
refactor(utils): convert git project root to posix path for backup file name
1 parent e2644c9 commit 820ada2

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎commitizen/cz/utils.py‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,17 @@ def strip_local_version(version: str) -> str:
2121

2222

2323
def get_backup_file_path() -> str:
24+
project_root = git.find_git_project_root()
25+
26+
if project_root is None:
27+
project = ""
28+
else:
29+
project = project_root.as_posix().replace("/", "%")
30+
2431
return os.path.join(
2532
tempfile.gettempdir(),
26-
"cz.commit%{user}%{project_root}.backup".format(
33+
"cz.commit%{user}%{project}.backup".format(
2734
user=os.environ.get("USER", ""),
28-
project_root=str(git.find_git_project_root()).replace("/", "%"),
35+
project=project,
2936
),
3037
)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /