mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-05 14:00:17 +02:00
create cache directory if it doesn't already exist
This commit is contained in:
@@ -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"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user