-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/SK-1229 | Project resource for CLI extension #784
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mycket bra! Har några kommentarer
fedn/cli/login_cmd.py
Outdated
if not os.path.exists(context_path): | ||
os.makedirs(context_path) | ||
try: | ||
with open(f"{context_path}/context.yaml", "w") as yaml_file: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vad händer om det redan finns en context.yaml med innehåll?
@@ -16,6 +18,8 @@ | |||
|
|||
API_VERSION = "v1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
detta måste funka för windows också, gör det det?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Some few things..
@@ -20,13 +19,13 @@ def login_cmd(ctx): | |||
|
|||
|
|||
@login_cmd.command("login") | |||
@click.option("-", "--name", required=False, default=None, help="username in studio") | |||
@click.option("-pw", "--password", required=False, default=None, help="password in studio") | |||
@click.option("-n", "--username", required=False, default=None, help="username in studio") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-u is more common
else: | ||
click.secho(f"Unexpected error: {response.text}", fg="red") | ||
click.secho(f"Unexpected error: {response.status_code}", fg="red") | ||
|
||
|
||
def get_context(response, protocol, host): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add typing
print(f"Error: Failed to write to YAML file. Details: {e}") | ||
|
||
click.secho(f"Project with slug {slug} is now active.", fg="green") | ||
click.echo("No projects available to activate.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"No projects available to set current context."
Features: