mirror of
https://github.com/hohn/codeql-javascript-multiflow.git
synced 2025-12-16 12:03:03 +01:00
Add session snapshot scripts
This commit is contained in:
committed by
=Michael Hohn
parent
8ac0490289
commit
5b294a18c8
31
cruft/snapshot-query
Executable file
31
cruft/snapshot-query
Executable file
@@ -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
|
||||
15
cruft/snapshot-setup
Executable file
15
cruft/snapshot-setup
Executable file
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user