Add --cdbg-config next to --config for cdbg

This commit is contained in:
Nils Hanke 2022-05-16 17:47:25 +02:00 committed by Nils Hanke
parent 68092f27dd
commit cdfd962fcc
2 changed files with 8 additions and 3 deletions

View File

@ -37,16 +37,20 @@ Specifying --coordinator will upload the coordinator from the specified path.`,
} }
func runDeploy(cmd *cobra.Command, args []string) error { func runDeploy(cmd *cobra.Command, args []string) error {
debugConfigName, err := cmd.Flags().GetString("cdbg-config")
if err != nil {
return err
}
configName, err := cmd.Flags().GetString("config") configName, err := cmd.Flags().GetString("config")
if err != nil { if err != nil {
return err return err
} }
fileHandler := file.NewHandler(afero.NewOsFs()) fileHandler := file.NewHandler(afero.NewOsFs())
debugConfig, err := config.FromFile(fileHandler, configName) debugConfig, err := config.FromFile(fileHandler, debugConfigName)
if err != nil { if err != nil {
return err return err
} }
constellationConfig, err := configc.FromFile(fileHandler, constants.ConfigFilename) constellationConfig, err := configc.FromFile(fileHandler, configName)
if err != nil { if err != nil {
return err return err
} }

View File

@ -22,5 +22,6 @@ func Execute() {
} }
func init() { func init() {
rootCmd.PersistentFlags().String("config", constants.DebugdConfigFilename, "debugd config file") rootCmd.PersistentFlags().String("config", constants.ConfigFilename, "Constellation config file")
rootCmd.PersistentFlags().String("cdbg-config", constants.DebugdConfigFilename, "debugd config file")
} }