File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ func updateIndexes() {
5757// TODO: This should be in packagemanager......
5858func updateIndex (URL * url.URL ) {
5959 logrus .WithField ("url" , URL ).Print ("Updating index" )
60- coreIndexPath := commands .Config .IndexesDir ().Join (path .Base (URL .Path ))
60+ indexDirPath := commands .Config .IndexesDir ()
61+ coreIndexPath := indexDirPath .Join (path .Base (URL .Path ))
6162
6263 tmpFile , err := ioutil .TempFile ("" , "" )
6364 if err != nil {
@@ -80,6 +81,11 @@ func updateIndex(URL *url.URL) {
8081 os .Exit (commands .ErrNetwork )
8182 }
8283
84+ if err := indexDirPath .MkdirAll (); err != nil {
85+ formatter .PrintError (err , "Can't create data directory " + indexDirPath .String ())
86+ os .Exit (commands .ErrGeneric )
87+ }
88+
8389 if err := paths .New (tmpFile .Name ()).CopyTo (coreIndexPath ); err != nil {
8490 formatter .PrintError (err , "Error saving downloaded index " + URL .String ())
8591 os .Exit (commands .ErrGeneric )
You can’t perform that action at this time.
0 commit comments