From 04e662ecd6395a6a070070507e0a4be336c3617f Mon Sep 17 00:00:00 2001 From: atusa17 Date: Tue, 12 Feb 2019 10:59:39 -0700 Subject: [PATCH] PAN-6 added a Windows batch file to load the DB on Windows systems. --- pandamonium-theorem-prover/persistence/build.gradle | 11 +++++++++-- .../persistence/scripts/mysql/loaddb.bat | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 pandamonium-theorem-prover/persistence/scripts/mysql/loaddb.bat diff --git a/pandamonium-theorem-prover/persistence/build.gradle b/pandamonium-theorem-prover/persistence/build.gradle index 24c2f75..a7b5ca9 100644 --- a/pandamonium-theorem-prover/persistence/build.gradle +++ b/pandamonium-theorem-prover/persistence/build.gradle @@ -1,3 +1,5 @@ +import org.gradle.internal.os.OperatingSystem; + plugins { id 'java' } @@ -28,6 +30,11 @@ dependencies { } task loadDb(type: Exec, group: 'Verification', description: 'Reloads the local database.') { - workingDir "./scripts/mysql" - commandLine './loaddb.sh' + if (OperatingSystem.current().isLinux() || OperatingSystem.current().isMacOsX()) { + workingDir "./scripts/mysql" + commandLine './loaddb.sh' + } else { + workingDir "./scripts/mysql" + commandLine 'loaddb.bat' + } } diff --git a/pandamonium-theorem-prover/persistence/scripts/mysql/loaddb.bat b/pandamonium-theorem-prover/persistence/scripts/mysql/loaddb.bat new file mode 100644 index 0000000..37c4da6 --- /dev/null +++ b/pandamonium-theorem-prover/persistence/scripts/mysql/loaddb.bat @@ -0,0 +1,5 @@ +SET MYSQL_PWD=secret +FOR /R %%s IN (.\*.sql) do ( + echo **** %%s **** + echo mysql --batch --quick --raw --line-numbers --force --user=panda < %%s +)