Skip to content

Commit 601880e

Browse files
committed
ci: mac updates
1 parent 83c821b commit 601880e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

sql/init-mysql.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/sh
22

3+
MYSQL_BIN=""
4+
35
if [ "$MYSQL_PWD" = "" ];
46
then
57
export MYSQL_PWD=root
@@ -9,7 +11,8 @@ then
911
Linux*)
1012
;;
1113
Darwin*)
12-
mysqladmin --user=root --password='' --protocol=tcp password 'root'
14+
MYSQL_BIN=/opt/homebrew/opt/[email protected]/bin/
15+
${MYSQL_BIN}mysqladmin --user=root --password='' --protocol=tcp password 'root'
1316
;;
1417
CYGWIN*|MINGW*|MINGW32*|MSYS*)
1518
mysqladmin --user=root --password='' --protocol=tcp password 'root'
@@ -21,14 +24,14 @@ fi
2124
# AUTH="--defaults-extra-file=./sql/my-gha.cnf"
2225

2326
if [ "$1" = "drop" ]; then
24-
mysql --user=root -e 'DROP DATABASE IF EXISTS nictool;' || exit 1
27+
${MYSQL_BIN}mysql --user=root -e 'DROP DATABASE IF EXISTS nictool;' || exit 1
2528
fi
26-
mysql --user=root -e 'CREATE DATABASE nictool;' || exit 1
29+
${MYSQL_BIN}mysql --user=root -e 'CREATE DATABASE nictool;' || exit 1
2730

2831
for f in ./sql/*.sql;
2932
do
3033
echo "cat $f | mysql nictool"
31-
cat $f | mysql --user=root nictool || exit 1
34+
cat $f | ${MYSQL_BIN}mysql --user=root nictool || exit 1
3235
done
3336

3437
exit 0

0 commit comments

Comments
 (0)