Skip to content

Commit

Permalink
#12: Launch in the working directory, instead of the 'drupalRoot'.
Browse files Browse the repository at this point in the history
  • Loading branch information
dasginganinja committed May 8, 2024
1 parent 79dc9b4 commit c1933c3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ func main() {
}

var drupalRoot string
cwd, err := os.Getwd()
if err != nil {
fmt.Println("Error getting current directory:", err)
os.Exit(1)
}

// Use the alternative Drupal root if provided
if altRoot != "" {
Expand All @@ -47,11 +52,6 @@ func main() {
}
} else {
// If no alternative root provided, find the Drupal root from the current directory
cwd, err := os.Getwd()
if err != nil {
fmt.Println("Error getting current directory:", err)
os.Exit(1)
}
drupalRoot, err = drushlauncher.FindDrushExecutable(cwd)
if err != nil {
fmt.Println(err)
Expand All @@ -74,7 +74,7 @@ func main() {
drushCmd.Env = os.Environ()

// Set the correct working directory for the drush command
drushCmd.Dir = drupalRoot
drushCmd.Dir = cwd

// Redirect standard input/output/error for the drush command
drushCmd.Stdin = os.Stdin
Expand Down

0 comments on commit c1933c3

Please sign in to comment.