fix: validate app name in app-scoped commands
This commit is contained in:
22 files changed
+213
-35
No files matched your search
@@ -50,7 +50,7 @@ func main() {
|
||||
args := flag.NewFlagSet("network:rebuild", flag.ExitOnError)
|
||||
args.Parse(os.Args[2:])
|
||||
appName := args.Arg(0)
|
||||
err = network.BuildConfig(appName)
|
||||
err = network.CommandRebuild(appName)
|
||||
case "rebuildall":
|
||||
args := flag.NewFlagSet("network:rebuildall", flag.ExitOnError)
|
||||
args.Parse(os.Args[2:])
|
||||
|
||||
@@ -148,6 +148,15 @@ func CommandList(format string, dokkuManaged bool) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// CommandRebuild rebuilds network settings for an app
|
||||
func CommandRebuild(appName string) error {
|
||||
if err := common.VerifyAppName(appName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return BuildConfig(appName)
|
||||
}
|
||||
|
||||
// CommandRebuildall rebuilds network settings for all apps
|
||||
func CommandRebuildall() error {
|
||||
apps, err := common.DokkuApps()
|
||||
|
||||
Reference in new issue
Block a user