From 6dca7e367b76e055c50ba9396c8dfac581ac713d Mon Sep 17 00:00:00 2001 From: yebyyy <144394157+yebyyy@users.noreply.github.com> Date: Tue, 9 Jan 2024 23:16:40 -0500 Subject: [PATCH] Bug 989 (#15) * Fixed id-token cmd to run mamba * making mamba running in uid.go * removing unnecessary codes --------- Co-authored-by: Xiaomeng Ye --- cmd/backend/id_token/id_token.go | 3 ++- cmd/backend/uid/uid.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/backend/id_token/id_token.go b/cmd/backend/id_token/id_token.go index 0f3a9f1..a8270a6 100644 --- a/cmd/backend/id_token/id_token.go +++ b/cmd/backend/id_token/id_token.go @@ -16,7 +16,8 @@ var IdTokenCmd = &cobra.Command{ Long: `gets a user's id token by email from the backend`, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { - backend.ExecBashCmd("poetry", "run", "python", "cli.py", "get-id-token", args[0]) + env_name := cmd.Flag("env-name").Value.String() + backend.ExecBashCmd("mamba", "run", "-n", env_name, "poetry", "run", "python", "cli.py", "get-id-token", args[0]) }, } diff --git a/cmd/backend/uid/uid.go b/cmd/backend/uid/uid.go index 0fd0620..bffd486 100644 --- a/cmd/backend/uid/uid.go +++ b/cmd/backend/uid/uid.go @@ -16,7 +16,8 @@ var UidCmd = &cobra.Command{ Long: `gets a user's uid by email from the backend`, Args: cobra.ExactArgs(1), Run: func(cmd *cobra.Command, args []string) { - backend.ExecBashCmd("poetry", "run", "python", "cli.py", "get-uid", args[0]) + env_name := cmd.Flag("env-name").Value.String() + backend.ExecBashCmd("mamba", "run", "-n", env_name, "poetry", "run", "python", "cli.py", "get-uid", args[0]) }, }