Change mysql build command to work when a custom socket is set

This commit is contained in:
Rafael Mendonça França 2023-02-07 15:49:31 +00:00
parent 81e1c338ff
commit 6017df6a8e
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
1 changed files with 5 additions and 1 deletions

View File

@ -205,7 +205,11 @@ namespace :db do
desc "Create the MySQL Rails User"
task :build_user do
if ENV["MYSQL_CODESPACES"]
mysql_command = "sudo mysql -uroot -proot -e"
if ENV["MYSQL_SOCK"]
mysql_command = "sudo mysql -uroot -S #{ENV["MYSQL_SOCK"]} -e"
else
mysql_command = "sudo mysql -uroot -proot -e"
end
else
mysql_command = "mysql -uroot -e"
end