Skip to content

Commit f80a459

Browse files
committed
fix dry with run npm 11
1 parent 74217eb commit f80a459

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

jupyter_releaser/lib.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,16 @@ def publish_assets(
417417
twine_cmd = "pipx run twine upload --repository-url=http://0.0.0.0:8081"
418418
os.environ["TWINE_USERNAME"] = "foo"
419419
twine_token = twine_token or "bar"
420-
npm_cmd = "npm publish --dry-run"
420+
# Preserve --tag flag if it was added for prereleases
421+
if " --tag " in npm_cmd:
422+
# Extract the tag and add --dry-run while preserving it
423+
tag_match = re.search(r"--tag\s+(\S+)", npm_cmd)
424+
if tag_match:
425+
npm_cmd = f"npm publish --dry-run --tag {tag_match.group(1)}"
426+
else:
427+
npm_cmd = "npm publish --dry-run"
428+
else:
429+
npm_cmd = "npm publish --dry-run"
421430
else:
422431
os.environ.setdefault("TWINE_USERNAME", "__token__")
423432

0 commit comments

Comments
 (0)