Skip to content

Commit 10540fc

Browse files
committed
Support for custom engine path with spaces
1 parent 5d9186e commit 10540fc

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

internal/menu/menu.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package menu
22

33
import (
4+
"bufio"
45
"fmt"
56
"os"
67
"path/filepath"
@@ -1050,8 +1051,12 @@ func changeScanRoots(app Application, config *config.Config) {
10501051

10511052
if utils.Confirm("Would you like to add a new scan root?") {
10521053
fmt.Print("Enter path to scan: ")
1053-
var newRoot string
1054-
fmt.Scanln(&newRoot)
1054+
scanner := bufio.NewScanner(os.Stdin)
1055+
scanner.Scan()
1056+
newRoot := strings.TrimSpace(scanner.Text())
1057+
1058+
// Handle quoted paths by removing quotes if present
1059+
newRoot = strings.Trim(newRoot, "\"")
10551060

10561061
if newRoot != "" {
10571062
config.CustomEngineRoots = append(config.CustomEngineRoots, newRoot)
@@ -1070,8 +1075,9 @@ func changeBranch(app Application, config *config.Config) {
10701075

10711076
fmt.Printf("Current branch: %s\n", config.DefaultRemoteBranch)
10721077
fmt.Print("Enter new branch name: ")
1073-
var newBranch string
1074-
fmt.Scanln(&newBranch)
1078+
scanner := bufio.NewScanner(os.Stdin)
1079+
scanner.Scan()
1080+
newBranch := strings.TrimSpace(scanner.Text())
10751081

10761082
if newBranch != "" {
10771083
config.DefaultRemoteBranch = newBranch

0 commit comments

Comments
 (0)