/
update.go
33 lines (29 loc) · 958 Bytes
/
update.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package cmd
import (
"github.com/spf13/cobra"
)
var updateCmd = &cobra.Command{
Use: "update",
Aliases: []string{"u"},
Short: "Update a resource",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
validateToken(lagoonCLIConfig.Current) // get a new token if the current one is invalid
},
}
var updateNotificationCmd = &cobra.Command{
Use: "notification",
Aliases: []string{"n"},
Short: "List all notifications or notifications on projects",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
validateToken(lagoonCLIConfig.Current) // get a new token if the current one is invalid
},
}
func init() {
updateCmd.AddCommand(updateProjectCmd)
updateCmd.AddCommand(updateEnvironmentCmd)
updateCmd.AddCommand(updateNotificationCmd)
updateCmd.AddCommand(updateUserCmd)
updateCmd.AddCommand(updateDeployTargetConfigCmd)
updateCmd.AddCommand(updateDeployTargetCmd)
updateCmd.AddCommand(updateOrganizationCmd)
}