Skip to content

Commit 847ff12

Browse files
committed
feat(globe_cli): paused project handle for deploy and build log
fixup
1 parent c864c0f commit 847ff12

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

packages/globe_cli/lib/src/utils/api.dart

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ class Project {
432432
required this.id,
433433
required this.orgId,
434434
required this.slug,
435+
required this.paused,
435436
required this.createdAt,
436437
required this.updatedAt,
437438
});
@@ -442,13 +443,30 @@ class Project {
442443
'id': final String id,
443444
'organizationId': final String organizationId,
444445
'slug': final String slug,
446+
'paused': final bool paused,
445447
'createdAt': final String createdAt,
446448
'updatedAt': final String updatedAt,
447449
} =>
448450
Project._(
449451
id: id,
450452
orgId: organizationId,
451453
slug: slug,
454+
paused: paused,
455+
createdAt: DateTime.parse(createdAt),
456+
updatedAt: DateTime.parse(updatedAt),
457+
),
458+
{
459+
'id': final String id,
460+
'organizationId': final String organizationId,
461+
'slug': final String slug,
462+
'createdAt': final String createdAt,
463+
'updatedAt': final String updatedAt,
464+
} =>
465+
Project._(
466+
id: id,
467+
orgId: organizationId,
468+
slug: slug,
469+
paused: false,
452470
createdAt: DateTime.parse(createdAt),
453471
updatedAt: DateTime.parse(updatedAt),
454472
),
@@ -459,6 +477,7 @@ class Project {
459477
final String id;
460478
final String orgId;
461479
final String slug;
480+
final bool paused;
462481
final DateTime createdAt;
463482
final DateTime updatedAt;
464483
}

packages/globe_cli/lib/src/utils/scope.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ class GlobeScope {
7878
'Either that project does not exists or you do not have permission to access to it.',
7979
),
8080
);
81+
82+
if (project.paused) {
83+
throw Exception(
84+
'Project #${metadata.projectId} is paused. '
85+
'So, new deployments cannot be created for this project.',
86+
);
87+
}
8188
} on ApiException catch (e) {
8289
logger.err(e.message);
8390
exitOverride(1);

0 commit comments

Comments
 (0)