Skip to content

Commit 8ba65f3

Browse files
author
Steven Silvester
committed
fix handling of npm token
1 parent fcab5aa commit 8ba65f3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

jupyter_releaser/npm.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,12 @@ def extract_package(path):
130130
def handle_npm_config(npm_token):
131131
"""Handle npm_config"""
132132
npmrc = Path(".npmrc")
133-
registry = os.environ.get("NPM_REGISTRY", "registry.npmjs.org")
133+
registry = os.environ.get("NPM_REGISTRY", "https://registry.npmjs.org/")
134+
registry = registry.replace('https:', '')
135+
registry = registry.replace('http:', '')
134136
text = f"registry={registry}"
135137
if npm_token:
136-
text += f"\n///{registry}:_authToken={npm_token}"
138+
text += f"\n{registry}:_authToken={npm_token}"
137139
if npmrc.exists():
138140
text = npmrc.read_text(encoding="utf-8") + text
139141
npmrc.write_text(text, encoding="utf-8")

0 commit comments

Comments
 (0)