Skip to content

Commit

Permalink
Create global versionGuard variable
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofMamak committed Nov 5, 2024
1 parent bfec7fc commit b993fe4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmd/poe.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var (
SilenceErrors: true,
SilenceUsage: true,
RunE: runPoe,
PreRunE: flutterConfigVersionGuard{}.GetFlutterConfigAndEnsureSufficientVersion,
PreRunE: versionGuard.GetFlutterConfigAndEnsureSufficientVersion,
}
termPrefixRegexp = regexp.MustCompile("[a-zA-Z]*")
)
Expand Down
11 changes: 7 additions & 4 deletions cmd/poe2arb.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ import (
"github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{
Use: "poe2arb",
Short: "POEditor JSON to Flutter ARB converter",
}
var (
rootCmd = &cobra.Command{
Use: "poe2arb",
Short: "POEditor JSON to Flutter ARB converter",
}
versionGuard = flutterConfigVersionGuard{}
)

type loggerKey struct{}

Expand Down
2 changes: 1 addition & 1 deletion cmd/seed.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var seedCmd = &cobra.Command{
SilenceErrors: true,
SilenceUsage: true,
RunE: runSeed,
PreRunE: flutterConfigVersionGuard{}.GetFlutterConfigAndEnsureSufficientVersion,
PreRunE: versionGuard.GetFlutterConfigAndEnsureSufficientVersion,
}

func init() {
Expand Down

0 comments on commit b993fe4

Please sign in to comment.