From 2e6bf7331a1a46f5b3a8ca634ed8356aba4bf875 Mon Sep 17 00:00:00 2001 From: lwc-tester Date: Wed, 4 Mar 2020 15:57:49 +0100 Subject: [PATCH] compile_all.py now accepts a submissions directory --- compile_all.py | 8 +++++--- process_zip.sh | 11 ++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/compile_all.py b/compile_all.py index 97b0e44..bf37960 100755 --- a/compile_all.py +++ b/compile_all.py @@ -93,7 +93,6 @@ def find_test_vectors(d): def main(argv): - submissions_dir = "all-lwc-submission-files" include_list = None # Parse the arguments @@ -101,15 +100,18 @@ def main(argv): description='Compiles all LWC submissions for a given template') argparser.add_argument('-v', '--verbose', action='count') - argparser.add_argument('-t', '--template', default='templates/linux') - argparser.add_argument('-b', '--build-dir') argparser.add_argument('-i', '--include', action='append') + argparser.add_argument('-t', '--template', default='templates/linux') + argparser.add_argument('-b', '--build-dir', default='build') + argparser.add_argument('-s', '--submissions-dir', + default='all-lwc-submission-files') args = argparser.parse_args(argv[1:]) template_dir = args.template build_root_dir = args.build_dir include_list = args.include + submissions_dir = args.submissions_dir print("Using template %s" % template_dir) subs = os.listdir(submissions_dir) diff --git a/process_zip.sh b/process_zip.sh index fafaca0..3fd9a2a 100755 --- a/process_zip.sh +++ b/process_zip.sh @@ -5,8 +5,9 @@ shopt -s extglob export PYTHONPATH="$PYTHONPATH:$(pwd)" function run() { - TEMPLATE="$1" - DESTDIR="$2" + SUBMISSION="$1" + TEMPLATE="$2" + DESTDIR="$3" if [[ ! -d "templates/$TEMPLATE" ]]; then echo "Template '$TEMPLATE' does not exist" @@ -29,7 +30,7 @@ function run() { mkdir -p $DESTDIR echo "Compiling for template '$TEMPLATE' in directory '$TMPDIR'" - ./compile_all.py -t "templates/$TEMPLATE" -b "$TMPDIR" + ./compile_all.py -s $SUBMISSION -t "templates/$TEMPLATE" -b "$TMPDIR" for cipher in $TMPDIR/*; do if [[ ! -d $cipher ]]; then continue; fi @@ -73,7 +74,7 @@ function run() { } if [[ $1 == "run" ]]; then - run $2 $3 + run $2 $3 $4 else ZIP_PATH="$1" if [[ ! -f $ZIP_PATH ]]; then @@ -89,7 +90,7 @@ else TEMPLATE="${i##*/}" echo "Template is $TEMPLATE" touch $MAINDIR/locky.lock - flock $MAINDIR/locky.lock $0 run $TEMPLATE $MAINDIR/$TEMPLATE + flock $MAINDIR/locky.lock $0 run $TMPDIR $TEMPLATE $MAINDIR/$TEMPLATE done rm -rf $TMPDIR -- libgit2 0.26.0