Skip to content

Commit

Permalink
misc: made local workspace file not required if using auth token
Browse files Browse the repository at this point in the history
  • Loading branch information
sheensantoscapadngan committed Aug 6, 2024
1 parent e684882 commit 3028bdd
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions cli/packages/cmd/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,22 +155,24 @@ var secretsSetCmd = &cobra.Command{
DisableFlagsInUseLine: true,
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
util.RequireLocalWorkspaceFile()
token, err := util.GetInfisicalToken(cmd)
if err != nil {
util.HandleError(err, "Unable to parse flag")
}

if (token == nil) {
util.RequireLocalWorkspaceFile()
}

environmentName, _ := cmd.Flags().GetString("env")
if !cmd.Flags().Changed("env") {
environmentFromWorkspace := util.GetEnvFromWorkspaceFile()
environmentFromWorkspace := util.GetEnvFromWorkspaceFile()
if environmentFromWorkspace != "" {
environmentName = environmentFromWorkspace
}
}

token, err := util.GetInfisicalToken(cmd)
if err != nil {
util.HandleError(err, "Unable to parse flag")
}

projectId, err := cmd.Flags().GetString("projectId")
projectId, err := cmd.Flags().GetString("projectId")
if err != nil {
util.HandleError(err, "Unable to parse flag")
}
Expand Down

0 comments on commit 3028bdd

Please sign in to comment.