@@ -45,10 +45,10 @@ func NewCmd(dockerCli command.Cli, isPlugin bool) *cobra.Command {
45
45
Short : "Docker Run, better" ,
46
46
RunE : func (cmd * cobra.Command , args []string ) error {
47
47
var (
48
- src string
49
- action string
50
- lc = runkit .GetLocalConfig ()
51
- cache = runkit .NewLocalCache (dockerCli )
48
+ src string
49
+ action string
50
+ lc = runkit .GetLocalConfig ()
51
+ localCache = runkit .NewLocalCache (dockerCli )
52
52
)
53
53
54
54
switch len (args ) {
@@ -79,6 +79,8 @@ func NewCmd(dockerCli command.Cli, isPlugin bool) *cobra.Command {
79
79
return cmd .Help ()
80
80
}
81
81
82
+ _ = localCache .EraseNotAccessedInLast30Days ()
83
+
82
84
var (
83
85
err error
84
86
rk * runkit.RunKit
@@ -89,14 +91,14 @@ func NewCmd(dockerCli command.Cli, isPlugin bool) *cobra.Command {
89
91
Type (spinner .Globe ).
90
92
Title (" Fetching runx details..." ).
91
93
Action (func () {
92
- rk , err = runkit .Get (cmd .Context (), cache , src )
94
+ rk , err = runkit .Get (cmd .Context (), localCache , src )
93
95
if err != nil {
94
96
_ , _ = fmt .Fprintln (dockerCli .Err (), err )
95
97
os .Exit (1 )
96
98
}
97
99
}).Run ()
98
100
} else {
99
- rk , err = runkit .Get (cmd .Context (), cache , src )
101
+ rk , err = runkit .Get (cmd .Context (), localCache , src )
100
102
}
101
103
if err != nil {
102
104
return err
0 commit comments