File tree Expand file tree Collapse file tree 2 files changed +0
-33
lines changed Expand file tree Collapse file tree 2 files changed +0
-33
lines changed Original file line number Diff line number Diff line change @@ -76,13 +76,7 @@ var OCICmd = &cobra.Command{
7676 fmt .Println (styles .ErrorStyle .Render ("error: " , err .Error ()))
7777 os .Exit (1 )
7878 }
79- oldName := artifact .Name
8079 artifact .Name = newName
81- err = hcl2nix .ModifyConfig (oldName , artifact , conf )
82- if err != nil {
83- fmt .Println (styles .ErrorStyle .Render ("error: " , err .Error ()))
84- os .Exit (1 )
85- }
8680 }
8781
8882 if dfSwap {
Original file line number Diff line number Diff line change @@ -68,33 +68,6 @@ func WriteConfig(config Config, wr io.Writer) error {
6868 return nil
6969}
7070
71- // ModifyConfig modifes the config
72- func ModifyConfig (oldName string , artifact OCIArtifact , config * Config ) error {
73- updated := false
74- for i , existingArtifact := range config .OCIArtifact {
75- if existingArtifact .Name == oldName {
76- config .OCIArtifact [i ] = artifact
77- updated = true
78- break
79- }
80- }
81-
82- if updated {
83- var buf bytes.Buffer
84- err := WriteConfig (* config , & buf )
85- if err != nil {
86- return err
87- }
88-
89- err = os .WriteFile ("bsf.hcl" , buf .Bytes (), 0644 )
90- if err != nil {
91- return err
92- }
93- }
94-
95- return nil
96- }
97-
9871// ReadConfig reads config from bytes and returns Config. If any errors are encountered, they are written to dstErr
9972func ReadConfig (src []byte , dstErr io.Writer ) (* Config , error ) {
10073 parser := hclparse .NewParser ()
You can’t perform that action at this time.
0 commit comments