@@ -45,10 +45,10 @@ func NewCmd(dockerCli command.Cli, isPlugin bool) *cobra.Command {
4545 Short : "Docker Run, better" ,
4646 RunE : func (cmd * cobra.Command , args []string ) error {
4747 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 )
5252 )
5353
5454 switch len (args ) {
@@ -79,6 +79,8 @@ func NewCmd(dockerCli command.Cli, isPlugin bool) *cobra.Command {
7979 return cmd .Help ()
8080 }
8181
82+ _ = localCache .EraseNotAccessedInLast30Days ()
83+
8284 var (
8385 err error
8486 rk * runkit.RunKit
@@ -89,14 +91,14 @@ func NewCmd(dockerCli command.Cli, isPlugin bool) *cobra.Command {
8991 Type (spinner .Globe ).
9092 Title (" Fetching runx details..." ).
9193 Action (func () {
92- rk , err = runkit .Get (cmd .Context (), cache , src )
94+ rk , err = runkit .Get (cmd .Context (), localCache , src )
9395 if err != nil {
9496 _ , _ = fmt .Fprintln (dockerCli .Err (), err )
9597 os .Exit (1 )
9698 }
9799 }).Run ()
98100 } else {
99- rk , err = runkit .Get (cmd .Context (), cache , src )
101+ rk , err = runkit .Get (cmd .Context (), localCache , src )
100102 }
101103 if err != nil {
102104 return err
0 commit comments