aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-03-06 16:30:09 +0000
committerMatthew Lemon <y@yulqen.org>2024-03-06 16:30:09 +0000
commitc099286b7e48e29ac89a146a62578fbb66b987b5 (patch)
treeb1d8aaee642f3c00c0e28d6348e54ca8a1e31684
parentd239245fdb899f7d58883c66aa601174b2437d62 (diff)
Added a new run.sh script - to be used as alternative to Makefile
-rwxr-xr-xscripts/run.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/run.sh b/scripts/run.sh
new file mode 100755
index 0000000..9da6747
--- /dev/null
+++ b/scripts/run.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+# This is required to handle return pNew; bug in sqlite
+export CGO_CFLAGS="-g -O2 -Wno-return-local-addr"
+
+# Ensure correct params passed into the script
+if [ ! -n "$1" ] || [ $1 == "help" ]
+then
+ echo "You must pass a parameter to this script."
+ echo "Use of 'test', 'test-all', 'build', 'clean-config', 'dummy-import', 'dummy-datamap-import' and 'debug-datamaps' is currently permitted."
+fi
+
+# Here is where we launch all the commands
+[[ $1 == "test" ]] && go test ./datamaps
+[[ $1 == "test-all" ]] && go test ./...
+[[ $1 == "build" ]] && go build -o build/datamaps ./cmd/datamaps/main.go
+[[ $1 == "clean-config" ]] && rm -r ~/.config/datamaps/
+[[ $1 == "dummy-import" ]] && go run ./cmd/datamaps/main.go import --returnname "Hunkers" --datamapname "Tonk 1" --xlsxpath datamaps/testdata/
+[[ $1 == "dummy-datamap-import" ]] && go run ./cmd/datamaps/main.go datamap --datamapname "Tonk 1" --import datamaps/testdata/datamap_matches_test_template.csv
+[[ $1 == "debug-datamaps" ]] && dlv test ./datamaps/ --wd ./datamaps/