File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -e
4+ set -x
5+
6+ # commits relevant files from the selected repositories and stores the used commit sha in $repo.txt
7+ repos=" codeql-ruby codeql codeql-go"
8+ for repo in $repos ; do
9+ echo " importing $repo "
10+ rm -rf " $repo " ;
11+ git clone --depth 1 git@github.com:github/" $repo " .git;
12+ git -C " $repo " rev-parse HEAD > " $repo .txt" ;
13+ # remove upgrades and tests (heuristic)
14+ find " $repo " -depth -type d \( -path " */upgrades" -o -path " */ql/test" \) -exec rm -rf {} \; ;
15+ # only preserve files mentioned in tools/autobuild.sh
16+ find " $repo " -type f -not \( -name " *.qll" -o -name " *.ql" -o -name " *.dbscheme" -o -name qlpack.yml \) -exec rm -f {} \; ;
17+ # remove empty directories (git does not care though)
18+ find " $repo " -type d -empty -delete;
19+ git add " $repo " " $repo .txt" ;
20+ git commit -m " Add $repo sources ($( tr -d ' \n' < $repo .txt) )" ;
21+ echo " done"
22+ done
You can’t perform that action at this time.
0 commit comments