From 5b294a18c8a7e85aa5ad929fa0c3db8b67754838 Mon Sep 17 00:00:00 2001 From: Michael Hohn Date: Sun, 26 Nov 2023 13:13:41 -0800 Subject: [PATCH] Add session snapshot scripts --- cruft/snapshot-query | 31 +++++++++++++++++++++++++++++++ cruft/snapshot-setup | 15 +++++++++++++++ 2 files changed, 46 insertions(+) create mode 100755 cruft/snapshot-query create mode 100755 cruft/snapshot-setup diff --git a/cruft/snapshot-query b/cruft/snapshot-query new file mode 100755 index 0000000..e96663a --- /dev/null +++ b/cruft/snapshot-query @@ -0,0 +1,31 @@ +#!/bin/bash + +usage="Take a snapshot of the current session.ql + +Usage: + $0 TheSnapShotName +" +if [ $# -ne 1 ] +then + echo "$usage" + exit 1 +fi + +if [ "$1" = "-h" ] +then + echo "$usage" + exit 1 +fi + +qname=$1 +# create the tests +mkdir tests/$qname +touch tests/$qname/$qname.expected +echo $qname.ql > tests/$qname/$qname.qlref +git add tests/$qname/$qname.* + +# snapshot the session +cp session.ql solutions/$qname.ql +git add solutions/$qname.ql + +# usage=snapshot-query ShowCmdFlowPath diff --git a/cruft/snapshot-setup b/cruft/snapshot-setup new file mode 100755 index 0000000..6fa2556 --- /dev/null +++ b/cruft/snapshot-setup @@ -0,0 +1,15 @@ +#!/bin/bash +usage="Set up the test / solution directories and a blank session + +Usage: + $0 +" +if [ $# -ne 0 ] +then + echo "$usage" + exit 1 +fi +mkdir -p tests +mkdir -p solutions +echo 'import javascript' > session.ql +