fix: make -S flag set absolute path to hilbish

pull/308/head
sammyette 2024-06-25 16:48:32 -04:00
parent 38d036d96f
commit 0e4b95d9b9
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 8 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"fmt" "fmt"
"io" "io"
"os" "os"
"os/exec"
"os/user" "os/user"
"path/filepath" "path/filepath"
"runtime" "runtime"
@ -115,7 +116,13 @@ func main() {
// Set $SHELL if the user wants to // Set $SHELL if the user wants to
if *setshflag { if *setshflag {
os.Setenv("SHELL", os.Args[0]) os.Setenv("SHELL", "hilbish")
path, err := exec.LookPath("hilbish")
if err == nil {
os.Setenv("SHELL", path)
}
} }
lr = newLineReader("", false) lr = newLineReader("", false)