Skip to content

Commit

Permalink
Added mac binary
Browse files Browse the repository at this point in the history
  • Loading branch information
gopuman committed Dec 4, 2023
1 parent a5c57d3 commit 9b6f23a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
Binary file added dist/resdb-cli-mac
Binary file not shown.
20 changes: 20 additions & 0 deletions resdb_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,26 @@ def create_instance(type):
except Exception as error:
click.echo(f"An unexpected error occurred: {error}", err=True)

@cli.command()
@click.argument("instance_id")
def exec_into(instance_id):
"""Bash into a running ResDB or PythonSDK instance"""
# Implement exec logic
try:
# Get the currently logged-in user
current_user = get_logged_in_user()
if not current_user:
click.echo("No user logged in. Please log in first.")
return

command = ["docker", "exec", "-it", instance_id, "bash"]
subprocess.run(command, check=True)

except subprocess.CalledProcessError as error:
click.echo(f"Error executing command: {error}", err=True)
except Exception as error:
click.echo(f"An unexpected error occurred: {error}", err=True)


@cli.command()
def view_instances():
Expand Down

0 comments on commit 9b6f23a

Please sign in to comment.