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
5 changes: 5 additions & 0 deletions .changeset/social-cooks-start.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@atomicsmash/cli": patch
---

Add timeout to herd/valet commands in case it tries to be interactive.
8 changes: 8 additions & 0 deletions packages/cli/src/commands/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ export async function handler() {
});
})(),
(async () => {
const ONE_MINUTE_IN_MS = 60000;
const timeout = setTimeout(() => {
throw new Error(
"Herd/Valet commands timed out. Please try again.",
);
}, ONE_MINUTE_IN_MS * 1.5);
if (
await execute(`herd --version`)
.then(() => true)
Expand Down Expand Up @@ -135,6 +141,7 @@ export async function handler() {
performance.measure("herd isolate", "herd link done"),
)})`,
);
clearTimeout(timeout);
})
.catch((error) => {
console.error(error);
Expand All @@ -147,6 +154,7 @@ export async function handler() {
) {
await execute(`valet link ${projectName} --secure --isolate`)
.then(() => {
clearTimeout(timeout);
console.log(
`Valet is linked, secured and isolated. (${convertMeasureToPrettyString(
performance.measure("herd-or-valet", "Start"),
Expand Down
Loading