From 862350b875bb9b1c6c62f87eaa42f7286b121df3 Mon Sep 17 00:00:00 2001 From: zegkljan Date: Fri, 28 Jan 2022 00:37:22 +0100 Subject: [PATCH] fix cmdline flags, fix initdb script * Actually parse the command line flags. * Remove CASCADE from drop table. --- .gitignore | 3 ++- main.go | 2 ++ server/initdb.sql | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 1edfb07..40b3cee 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,5 @@ go.work .nfs* # Project-specific -oko-server \ No newline at end of file +oko-server +*.sqlite* \ No newline at end of file diff --git a/main.go b/main.go index 83d9dbe..b8acfa8 100644 --- a/main.go +++ b/main.go @@ -16,6 +16,8 @@ func main() { tilepackFileArg := flag.String("tilepack", "", "File that will be sent to clients when they request a tile pack. Required.") apkFileArg := flag.String("apk", "", "APK file with the client app. If not specified, no APK will be available (404).") + flag.Parse() + s := server.New(*dbFileArg, *tilepackFileArg, *apkFileArg) sigs := make(chan os.Signal, 1) diff --git a/server/initdb.sql b/server/initdb.sql index d86dfb5..9c3ce5f 100644 --- a/server/initdb.sql +++ b/server/initdb.sql @@ -1,4 +1,4 @@ -DROP TABLE IF EXISTS users CASCADE; +DROP TABLE IF EXISTS users; CREATE TABLE IF NOT EXISTS users ( id integer PRIMARY KEY AUTOINCREMENT, name text NOT NULL UNIQUE