Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions src/core/project/manager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1004,18 +1004,13 @@ export class FsProjectManager implements ProjectManager {
name: string,
): Promise<AwsDeploymentTarget> {
const targetsPath = join(project.rootPath, "agentcore", "aws-targets.json");
if (!existsSync(targetsPath)) {
throw new ProjectStateError(
`No deployment targets are configured for project '${project.name}'. ` +
`Add ${targetsPath}, for example:\n\n${TARGETS_EXAMPLE}`,
);
}

const targets = await this.json.read(targetsPath, AwsDeploymentTargetsSchema);
const targets = existsSync(targetsPath)
? await this.json.read(targetsPath, AwsDeploymentTargetsSchema)
: [];
if (targets.length === 0) {
throw new ProjectStateError(
`No deployment targets are configured for project '${project.name}'. ` +
`Add at least one to ${targetsPath}, for example:\n\n${TARGETS_EXAMPLE}`,
`Please deploy your project using 'agentcore project deploy'.`,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/handlers/project/status/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ describe("project status handler", () => {
await inProject(subject, { memories: [memory("shortTerm")] }, []);

await expect(subject.run()).rejects.toThrow(
/No deployment targets are configured for project 'orders'/,
/No deployment targets are configured for project 'orders'\. Please deploy your project using 'agentcore project deploy'\./,
);
expect(subject.targets).toEqual([]);
});
Expand Down
Loading