mirror of
https://github.com/hohn/codeql-javascript-multiflow.git
synced 2025-12-16 12:03:03 +01:00
Add def-use code sample and query
This commit is contained in:
committed by
=Michael Hohn
parent
60ee4295b2
commit
bf9197cb57
36
cruft/snapshot-query-1
Executable file
36
cruft/snapshot-query-1
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/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 sample-utility-0.js tests/$qname/
|
||||
git add tests/$qname/sample-utility-0.js
|
||||
|
||||
cp 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
|
||||
@@ -11,5 +11,6 @@ then
|
||||
fi
|
||||
mkdir -p tests
|
||||
mkdir -p solutions
|
||||
echo 'import javascript' > session.ql
|
||||
echo 'import javascript' > session/session.ql
|
||||
echo 'import javascript' > session/session1.ql
|
||||
|
||||
|
||||
Reference in New Issue
Block a user