Skip to content

Commit 401e911

Browse files
committed
Read npm versions before git checkout -- .
1 parent 1b002a1 commit 401e911

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

jupyter_releaser/lib.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ def draft_changelog(version_spec, branch, repo, since, auth, changelog_path, dry
8989
branch = branch or util.get_branch()
9090
version = util.get_version()
9191

92+
# Check for multiple versions
93+
npm_versions = None
94+
if util.PACKAGE_JSON.exists():
95+
npm_versions = npm.get_package_versions(version)
96+
9297
tags = util.run("git --no-pager tag", quiet=True)
9398
if f"v{version}" in tags.splitlines():
9499
raise ValueError(f"Tag v{version} already exists")
@@ -108,9 +113,8 @@ def draft_changelog(version_spec, branch, repo, since, auth, changelog_path, dry
108113
commit_message = f'git commit -a -m "{title}"'
109114
body = title
110115

111-
# Check for multiple versions
112-
if util.PACKAGE_JSON.exists():
113-
body += npm.get_package_versions(version)
116+
if npm_versions:
117+
body += npm_versions
114118

115119
body += '\n\nAfter merging this PR run the "Draft Release" Workflow on your fork of `jupyter_releaser` with the following inputs'
116120
body += f"""

0 commit comments

Comments
 (0)