File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ const sha256File = require('sha256-file');
12
12
* @param {Object } serverless
13
13
* @return {undefined }
14
14
*/
15
- function checkForAndDeleteMaxCacheVersions ( options , serverless ) {
15
+ function checkForAndDeleteMaxCacheVersions ( { serverless , options, log } ) {
16
16
// If we're using the static cache, and we have static cache max versions enabled
17
17
if (
18
18
options . useStaticCache &&
@@ -42,10 +42,17 @@ function checkForAndDeleteMaxCacheVersions(options, serverless) {
42
42
rimraf . sync ( files [ i ] ) ;
43
43
items ++ ;
44
44
}
45
+
45
46
// Log the number of cache files flushed
46
- serverless . cli . log (
47
- `Removed ${ items } items from cache because of staticCacheMaxVersions`
48
- ) ;
47
+ if ( log ) {
48
+ log . info (
49
+ `Removed ${ items } items from cache because of staticCacheMaxVersions`
50
+ ) ;
51
+ } else {
52
+ serverless . cli . log (
53
+ `Removed ${ items } items from cache because of staticCacheMaxVersions`
54
+ ) ;
55
+ }
49
56
}
50
57
}
51
58
}
You can’t perform that action at this time.
0 commit comments