@@ -26,18 +26,12 @@ export const command = new Command("functions:artifacts:setpolicy")
2626 )
2727 . option (
2828 "--days <days>" ,
29- "Number of days to keep container images before deletion. Default is 3 days." ,
30- "3" ,
29+ `Number of days to keep container images before deletion. Default is ${ artifacts . DEFAULT_CLEANUP_DAYS } day.` ,
3130 )
3231 . option (
3332 "--none" ,
3433 "Opt-out from cleanup policy. This will prevent suggestions to set up a cleanup policy during initialization and deployment." ,
3534 )
36- . before ( ( options ) => {
37- if ( options . days && options . none ) {
38- throw new FirebaseError ( "Cannot specify both --days and --none options." ) ;
39- }
40- } )
4135 . withForce ( "Automatically create or modify cleanup policy" )
4236 . before ( requireAuth )
4337 . before ( async ( options ) => {
@@ -49,9 +43,12 @@ export const command = new Command("functions:artifacts:setpolicy")
4943 "artifactregistry.versions.delete" ,
5044 ] )
5145 . action ( async ( options : any ) => {
46+ if ( options . days && options . none ) {
47+ throw new FirebaseError ( "Cannot specify both --days and --none options." ) ;
48+ }
5249 const projectId = needProjectId ( options ) ;
5350 const location = options . location || "us-central1" ;
54- let daysToKeep = parseInt ( options . days || "3" , 10 ) ;
51+ let daysToKeep = parseInt ( options . days || artifacts . DEFAULT_CLEANUP_DAYS , 10 ) ;
5552
5653 const repoPath = artifacts . makeRepoPath ( projectId , location ) ;
5754 let repository : artifactregistry . Repository ;
0 commit comments