Skip to content

Commit

Permalink
chore: fix flag 'config-dir'
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickMenoti committed Jun 19, 2024
1 parent 93bf903 commit f21a395
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 25 deletions.
2 changes: 1 addition & 1 deletion pkg/cmd/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func NewCobraCmd(build *BuildCmd) *cobra.Command {
buildCmd.Flags().StringVar(&fields.NodePolyfills, "use-node-polyfills", "", msg.FlagPolyfill)
buildCmd.Flags().StringVar(&fields.OwnWorker, "use-own-worker", "", msg.FlagWorker)
buildCmd.Flags().BoolVar(&fields.IsFirewall, "firewall", false, msg.IsFirewall)
buildCmd.Flags().StringVar(&fields.ProjectPath, "--config-dir", "azion", msg.ProjectConfFlag)
buildCmd.Flags().StringVar(&fields.ProjectPath, "config-dir", "azion", msg.ProjectConfFlag)

return buildCmd
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/delete/edge_application/edge_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func NewCobraCmd(delete *DeleteCmd) *cobra.Command {
cmd.Flags().Int64Var(&application_id, "application-id", 0, msg.FlagId)
cmd.Flags().Bool("cascade", true, msg.CascadeFlag)
cmd.Flags().BoolP("help", "h", false, msg.HelpFlag)
cmd.Flags().StringVar(&ProjectConf, "--config-dir", "azion", msg.CONFDIRFLAG)
cmd.Flags().StringVar(&ProjectConf, "config-dir", "azion", msg.CONFDIRFLAG)

return cmd
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewCobraCmd(sync *SyncCmd) *cobra.Command {
},
}
syncCmd.Flags().BoolP("help", "h", false, msg.HELPFLAG)
syncCmd.Flags().StringVar(&ProjectConf, "--config-dir", "azion", msg.CONFDIRFLAG)
syncCmd.Flags().StringVar(&ProjectConf, "config-dir", "azion", msg.CONFDIRFLAG)
return syncCmd
}

Expand Down
3 changes: 1 addition & 2 deletions pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ var (
)

const (
PathAzionJson = "/azion/azion.json"
FORMAT_DATE = "2006-01-02 15:04:05 -0700 MST"
FORMAT_DATE = "2006-01-02 15:04:05 -0700 MST"
)
20 changes: 0 additions & 20 deletions utils/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,26 +237,6 @@ func GetAzionJsonContent(confPath string) (*contracts.AzionApplicationOptions, e
return conf, nil
}

func GetAzionJsonSimple() (*contracts.AzionApplicationSimple, error) {
path, err := GetWorkingDir()
if err != nil {
return nil, err
}
jsonConf := path + "/azion/azion.json"
file, err := os.ReadFile(jsonConf)
if err != nil {
return nil, ErrorOpeningAzionJsonFile
}

conf := &contracts.AzionApplicationSimple{}
err = json.Unmarshal(file, &conf)
if err != nil {
return nil, ErrorUnmarshalAzionJsonFile
}

return conf, nil
}

func WriteAzionJsonContent(conf *contracts.AzionApplicationOptions, confPath string) error {
wd, err := GetWorkingDir()
if err != nil {
Expand Down

0 comments on commit f21a395

Please sign in to comment.