diff --git a/dump.go b/dump.go index c259cd6..4b65d33 100644 --- a/dump.go +++ b/dump.go @@ -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) diff --git a/utils/vars.go b/utils/vars.go index c7ee90e..19bfbe7 100644 --- a/utils/vars.go +++ b/utils/vars.go @@ -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" diff --git a/utils/vars_windows.go b/utils/vars_windows.go index 66bc9e6..c73af28 100644 --- a/utils/vars_windows.go +++ b/utils/vars_windows.go @@ -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"