create cache directory if it doesn't already exist
This commit is contained in:
parent
f99e5f5c6d
commit
a74dc78c65
|
|
@ -51,6 +51,12 @@ var RootCmd = &cobra.Command{
|
|||
return nil
|
||||
},
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if _, err := os.Stat(opts.CacheDir); os.IsNotExist(err) {
|
||||
err = os.MkdirAll(opts.CacheDir, 0755)
|
||||
if err != nil {
|
||||
exit(errors.Wrap(err, "Failed to create cache directory"))
|
||||
}
|
||||
}
|
||||
if err := cache.WarmCache(opts); err != nil {
|
||||
exit(errors.Wrap(err, "Failed warming cache"))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue