install.sh: keep the studio launch from draining the curl | sh script (#6258)
When installed via 'curl -fsSL https://unsloth.ai/install.sh | sh', the shell reads the script from the pipe on stdin. The optional 'start now' step launches 'unsloth studio' in the foreground, and as a server it inherits and drains the rest of the piped script from stdin. The shell then hits EOF partway through the trailing if/case and dies with 'Syntax error: end of file unexpected (expecting fi)' (reported on WSL, where /bin/sh is dash). Redirect the launch's stdin away from the pipe so the script stays intact. The server does not read stdin and Ctrl+C still works via the controlling terminal.
This commit is contained in:
parent
4c4422893c
commit
be2a122e21
1 changed files with 4 additions and 1 deletions
|
|
@ -2900,7 +2900,10 @@ if [ -t 1 ]; then
|
|||
case "${_reply:-y}" in
|
||||
[Yy]*|"")
|
||||
step "launch" "starting Unsloth Studio..."
|
||||
"$VENV_DIR/bin/unsloth" studio -p 8888
|
||||
# Detach stdin from the `curl | sh` pipe: as a foreground server the
|
||||
# studio would otherwise drain the rest of this piped script, leaving
|
||||
# the shell to die parsing the now-truncated tail (`unexpected fi`).
|
||||
"$VENV_DIR/bin/unsloth" studio -p 8888 </dev/null
|
||||
_LAUNCH_EXIT=$?
|
||||
if [ "$_LAUNCH_EXIT" -ne 0 ] && [ "$_MIGRATED" = true ]; then
|
||||
echo ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue