Skip to content

Commit

Permalink
fix: split command and argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Rex-82 committed Sep 23, 2024
1 parent 9558d69 commit 77906d9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func RunMysqldump(command, username, password, databaseName, migrationType, dire

fmt.Print("Running...\n")

cmd := exec.Command(utils.SHELL_CMD, dumpCommand)
cmd := exec.Command(utils.SHELL_CMD, utils.SHELL_CMD_ARG, dumpCommand)
output, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("command execution failed: %v, output: %s", err, output)
Expand Down
3 changes: 2 additions & 1 deletion utils/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ package utils
var MYSQL_BIN = "/opt/lampp/bin/mysql"
var MYSQLDUMP_BIN = "/opt/lampp/bin/mysqldump"

var SHELL_CMD = "sh -c"
var SHELL_CMD = "sh"
var SHELL_CMD_ARG = "-c"
3 changes: 2 additions & 1 deletion utils/vars_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ package utils
var MYSQL_BIN = "c:\\xampp\\mysql\\bin\\mysql.exe"
var MYSQLDUMP_BIN = "c:\\xampp\\mysql\\bin\\mysqldump.exe"

var SHELL_CMD = "cmd /C"
var SHELL_CMD = "cmd"
var SHELL_CMD_ARG = "/C"

0 comments on commit 77906d9

Please sign in to comment.