File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -170,12 +170,7 @@ func (cmd *RemoveCmd) RunRemovePackage(cobraCmd *cobra.Command, args []string) {
170170 dependenciesArr = append (dependenciesArr [:key ], dependenciesArr [key + 1 :]... )
171171 yamlContents ["dependencies" ] = dependenciesArr
172172
173- err = yamlutil .WriteYamlToFile (yamlContents , requirementsPath )
174- if err != nil {
175- log .Fatal (err )
176- }
177-
178- cmd .rebuildDependencies ()
173+ cmd .rebuildDependencies (yamlContents )
179174 break
180175 }
181176 }
@@ -187,25 +182,25 @@ func (cmd *RemoveCmd) RunRemovePackage(cobraCmd *cobra.Command, args []string) {
187182
188183 yamlContents ["dependencies" ] = []interface {}{}
189184
190- err = yamlutil .WriteYamlToFile (yamlContents , requirementsPath )
191- if err != nil {
192- log .Fatal (err )
193- }
194-
195- cmd .rebuildDependencies ()
185+ cmd .rebuildDependencies (yamlContents )
196186 log .Done ("Successfully removed all dependencies" )
197187 return
198188 }
199189
200190 log .Done ("No dependencies found" )
201191}
202192
203- func (cmd * RemoveCmd ) rebuildDependencies () {
193+ func (cmd * RemoveCmd ) rebuildDependencies (newYamlContents map [ interface {}] interface {} ) {
204194 cwd , err := os .Getwd ()
205195 if err != nil {
206196 log .Fatal (err )
207197 }
208198
199+ err = yamlutil .WriteYamlToFile (newYamlContents , filepath .Join (cwd , "chart" , "requirements.yaml" ))
200+ if err != nil {
201+ log .Fatal (err )
202+ }
203+
209204 // Rebuild dependencies
210205 kubectl , err := kubectl .NewClient ()
211206 if err != nil {
You can’t perform that action at this time.
0 commit comments