mirror of
https://github.com/hohn/codeql-javascript-multiflow.git
synced 2025-12-16 12:03:03 +01:00
37 lines
678 B
Bash
Executable File
37 lines
678 B
Bash
Executable File
#!/bin/bash
|
|
|
|
usage="Take a snapshot of the current session1.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 source/sample-utility-0.js tests/$qname/
|
|
git add tests/$qname/sample-utility-0.js
|
|
|
|
cp source/sample-utility-1.js tests/$qname/
|
|
git add tests/$qname/sample-utility-1.js
|
|
|
|
cp session/session1.ql solutions/$qname.ql
|
|
git add solutions/$qname.ql
|