File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ func updateIndexes() {
57
57
// TODO: This should be in packagemanager......
58
58
func updateIndex (URL * url.URL ) {
59
59
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 ))
61
62
62
63
tmpFile , err := ioutil .TempFile ("" , "" )
63
64
if err != nil {
@@ -80,6 +81,11 @@ func updateIndex(URL *url.URL) {
80
81
os .Exit (commands .ErrNetwork )
81
82
}
82
83
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
+
83
89
if err := paths .New (tmpFile .Name ()).CopyTo (coreIndexPath ); err != nil {
84
90
formatter .PrintError (err , "Error saving downloaded index " + URL .String ())
85
91
os .Exit (commands .ErrGeneric )
You can’t perform that action at this time.
0 commit comments