@@ -7,7 +7,7 @@ import * as core from '@actions/core';
77import * as exec from '@actions/exec' ;
88import * as glob from '@actions/glob' ;
99import * as tc from '@actions/tool-cache' ;
10- import { padDate , rmrf } from './helpers ' ;
10+ import { rmrf } from './fs ' ;
1111import { RUST_HASH , RUST_VERSION } from './rust' ;
1212
1313export const CARGO_HOME = process . env . CARGO_HOME ?? path . join ( os . homedir ( ) , '.cargo' ) ;
@@ -129,19 +129,7 @@ export async function cleanCargoRegistry() {
129129 const registryDir = path . join ( CARGO_HOME , 'registry' ) ;
130130
131131 // .cargo/registry/src - Delete entirely
132- const staleDate = new Date ( ) ;
133-
134- // eslint-disable-next-line no-magic-numbers
135- staleDate . setDate ( staleDate . getDate ( ) - 14 ) ;
136-
137- await exec . exec ( 'cargo' , [
138- 'cache' ,
139- '--autoclean' ,
140- '--remove-if-older-than' ,
141- `${ staleDate . getFullYear ( ) } .${ padDate ( staleDate . getMonth ( ) + 1 ) } .${ padDate (
142- staleDate . getDate ( ) ,
143- ) } `,
144- ] ) ;
132+ await exec . exec ( 'cargo' , [ 'cache' , '--autoclean' ] ) ;
145133
146134 // .cargo/registry/index - Delete .cache directories
147135 const indexDir = path . join ( registryDir , 'index' ) ;
0 commit comments