-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
populateOrgName
param in /v1/workspace
api which adds `orgN…
…ame` and `displayName` in result Updated the CLI to use this new paramter to display organization name with project name with support for backward compatibility keeping original behaviour for older apis
- Loading branch information
1 parent
2192985
commit 756c1e5
Showing
8 changed files
with
69 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package util | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/Infisical/infisical-merge/packages/api" | ||
) | ||
|
||
func GetWorkspacesNameList(workspaceResponse api.GetWorkSpacesResponse) ([]string, error) { | ||
workspaces := workspaceResponse.Workspaces | ||
|
||
if len(workspaces) == 0 { | ||
message := fmt.Sprintf("You don't have any projects created in Infisical. You must first create a project at %s", INFISICAL_TOKEN_NAME) | ||
PrintErrorMessageAndExit(message) | ||
} | ||
|
||
var workspaceNames []string | ||
for _, workspace := range workspaces { | ||
if workspace.DisplayName != nil { | ||
workspaceNames = append(workspaceNames, *workspace.DisplayName) | ||
} else { | ||
workspaceNames = append(workspaceNames, workspace.Name) | ||
} | ||
} | ||
|
||
return workspaceNames, nil | ||
} |