Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Commit e7570ac

Browse files
author
Sam McGeown
committed
Remove --importFile flag and rely on --importPath
1 parent b060b8b commit e7570ac

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

cmd/customintegration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ func init() {
156156
getCmd.AddCommand(getCustomIntegrationCmd)
157157
getCustomIntegrationCmd.Flags().StringVarP(&name, "name", "n", "", "List customintegration with name")
158158
getCustomIntegrationCmd.Flags().StringVarP(&id, "id", "i", "", "List customintegrations by id")
159-
getCustomIntegrationCmd.Flags().StringVarP(&exportFile, "exportFile", "", "", "Path to export objects - relative or absolute location")
159+
getCustomIntegrationCmd.Flags().StringVarP(&exportPath, "exportPath", "", "", "Path to export objects - relative or absolute location")
160160
// // Create CustomIntegration
161161
// createCmd.AddCommand(createCustomIntegrationCmd)
162162
// createCustomIntegrationCmd.Flags().StringVarP(&name, "name", "n", "", "The name of the customintegration to create")

cmd/root.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ var (
3535
value string
3636
description string
3737
status string
38-
exportFile string
39-
importFile string
40-
printJson bool
41-
exportPath string
42-
importPath string
38+
// exportFile string
39+
// importFile string
40+
printJson bool
41+
exportPath string
42+
importPath string
4343
)
4444

4545
var qParams = map[string]string{

cmd/variable.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Get by Project
4343
} else if resultCount == 1 {
4444
// Print the single result
4545
if exportPath != "" {
46-
exportVariable(response[0], exportFile)
46+
exportVariable(response[0], exportPath)
4747
}
4848
PrettyPrint(response[0])
4949
} else {
@@ -52,7 +52,7 @@ Get by Project
5252
table.SetHeader([]string{"Id", "Name", "Project", "Type", "Description"})
5353
for _, c := range response {
5454
if exportPath != "" {
55-
exportVariable(c, exportFile)
55+
exportVariable(c, exportPath)
5656
}
5757
table.Append([]string{c.ID, c.Name, c.Project, c.Type, c.Description})
5858
}
@@ -71,8 +71,8 @@ var createVariableCmd = &cobra.Command{
7171
log.Fatalln(err)
7272
}
7373

74-
if importFile != "" { // If we are importing a file
75-
variables := importVariables(importFile)
74+
if importPath != "" { // If we are importing a file
75+
variables := importVariables(importPath)
7676
for _, value := range variables {
7777
if project != "" { // If the project is specified update the object
7878
value.Project = project
@@ -104,8 +104,8 @@ var updateVariableCmd = &cobra.Command{
104104
log.Fatalln(err)
105105
}
106106

107-
if importFile != "" { // If we are importing a file
108-
variables := importVariables(importFile)
107+
if importPath != "" { // If we are importing a file
108+
variables := importVariables(importPath)
109109
for _, value := range variables {
110110
exisitingVariable, err := getVariable("", value.Name, value.Project)
111111
if err != nil {
@@ -161,7 +161,7 @@ func init() {
161161
createVariableCmd.Flags().StringVarP(&project, "project", "p", "", "The project in which to create the variable")
162162
createVariableCmd.Flags().StringVarP(&value, "value", "v", "", "The value of the variable to create")
163163
createVariableCmd.Flags().StringVarP(&description, "description", "d", "", "The description of the variable to create")
164-
createVariableCmd.Flags().StringVarP(&importFile, "importfile", "i", "", "Path to a YAML file with the variables to import")
164+
createVariableCmd.Flags().StringVarP(&importPath, "importpath", "i", "", "Path to a YAML file with the variables to import")
165165

166166
// Update Variable
167167
updateCmd.AddCommand(updateVariableCmd)
@@ -170,7 +170,7 @@ func init() {
170170
updateVariableCmd.Flags().StringVarP(&typename, "type", "t", "", "Update the type of the variable REGULAR|SECRET|RESTRICTED")
171171
updateVariableCmd.Flags().StringVarP(&value, "value", "v", "", "Update the value of the variable ")
172172
updateVariableCmd.Flags().StringVarP(&description, "description", "d", "", "Update the description of the variable")
173-
updateVariableCmd.Flags().StringVarP(&importFile, "importfile", "", "", "Path to a YAML file with the variables to import")
173+
updateVariableCmd.Flags().StringVarP(&importPath, "importpath", "", "", "Path to a YAML file with the variables to import")
174174
//updateVariableCmd.MarkFlagRequired("id")
175175
// Delete Variable
176176
deleteCmd.AddCommand(deleteVariableCmd)

0 commit comments

Comments
 (0)