From c099286b7e48e29ac89a146a62578fbb66b987b5 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Wed, 6 Mar 2024 16:30:09 +0000 Subject: Added a new run.sh script - to be used as alternative to Makefile --- scripts/run.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 scripts/run.sh 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/ -- cgit v1.2.3