Files
codeql-javascript-multiflow/cruft/snapshot-query
2023-11-26 14:06:44 -08:00

34 lines
567 B
Bash
Executable File

#!/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 -p tests/$qname
touch tests/$qname/$qname.expected
echo $qname.ql > tests/$qname/$qname.qlref
git add tests/$qname/$qname.expected
git add tests/$qname/$qname.qlref
# snapshot the session
cp add-user.js tests/$qname/
git add tests/$qname/add-user.js
cp session/session.ql solutions/$qname.ql
git add solutions/$qname.ql