File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/commands/package/pushupgrade Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -54,14 +54,22 @@ export class PackagePushRequestListCommand extends SfCommand<PackagePushRequestL
54
54
public async run ( ) : Promise < PackagePushRequestListResultArr > {
55
55
const { flags } = await this . parse ( PackagePushRequestListCommand ) ;
56
56
this . connection = flags [ 'target-dev-hub' ] . getConnection ( '61.0' ) ;
57
+ const scheduledLastDays = flags [ 'scheduled-last-days' ] ;
58
+
59
+ // Check if scheduledLastDays is valid
60
+ if ( flags [ 'scheduled-last-days' ] !== undefined ) {
61
+ if ( isNaN ( scheduledLastDays ! ) || scheduledLastDays ! <= 0 ) {
62
+ throw new Error ( 'Invalid value for --scheduled-last-days. It must be a positive integer.' ) ;
63
+ }
64
+ }
57
65
58
66
// Get results of query here
59
67
// Use const since we will add verbose later
60
68
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment
61
69
const results : PackagePushRequestListResult [ ] = await PackagePushUpgrade . list ( this . connection , {
62
70
packageId : flags . packageid ,
63
71
status : flags . status ,
64
- scheduledLastDays : flags [ 'scheduled-last-days' ] ,
72
+ scheduledLastDays,
65
73
} ) ;
66
74
67
75
if ( results . length === 0 ) {
You can’t perform that action at this time.
0 commit comments