Skip to content

Commit a9630c5

Browse files
committed
fix: add exit 0 after main to prevent bash hanging on curl pipe
exec < /dev/tty redirects stdin to terminal for interactive prompts, but after main() finishes bash keeps reading from tty instead of exiting.
1 parent 7909d9b commit a9630c5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/lib/server/install-script.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ describe('generateInstallScript', () => {
116116
const script = generateInstallScript('testuser', 'my-config', '', '');
117117

118118
expect(script).toContain('main()');
119-
expect(script).toMatch(/main "\$@"\s*$/);
119+
expect(script).toMatch(/main "\$@"\s*\nexit 0\s*$/);
120120
expect(script).toContain('exec < /dev/tty');
121121
});
122122

src/lib/server/install-script.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,5 +293,6 @@ echo "Installation complete!"
293293
}
294294
295295
main "\$@"
296+
exit 0
296297
`;
297298
}

0 commit comments

Comments
 (0)