Skip to content

Commit

Permalink
Publisher support google artifacts repository
Browse files Browse the repository at this point in the history
  • Loading branch information
ischaojie committed Apr 26, 2023
1 parent 7a89af2 commit f3d58ec
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/hatch/publish/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,17 @@ def publish(self, artifacts: list, options: dict):
else:
user = repo_config.get('user', '')
if not user:
import keyring

user = cached_user_file.get_user(repo)
if user is None:
if options['no_prompt']:
self.app.abort('Missing required option: user')
else:
user = updated_user = self.app.prompt('Enter your username')
creds = keyring.get_credential(repo, None)
user = creds and creds.username
if user is None:
if options['no_prompt']:
self.app.abort('Missing required option: user')
else:
user = updated_user = self.app.prompt('Enter your username')
index.user = user

updated_auth = None
Expand Down

0 comments on commit f3d58ec

Please sign in to comment.