From 5048dbe35978f11292a73d25ebc30fe85dcdb506 Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Thu, 26 Jan 2023 18:53:34 -0800 Subject: [PATCH] codeql - remove codeql database before initializing it. If the database already exists, the next run fails with a database exists error. --- src/tox_lsr/test_scripts/runcodeql.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tox_lsr/test_scripts/runcodeql.sh b/src/tox_lsr/test_scripts/runcodeql.sh index 14e65be..c52bb79 100755 --- a/src/tox_lsr/test_scripts/runcodeql.sh +++ b/src/tox_lsr/test_scripts/runcodeql.sh @@ -66,6 +66,9 @@ sed -e "s/pip install --user/pip install/" \ $CODEQLACTIONDIR/python-setup/install_tools.sh > "$LSR_TOX_ENV_TMP_DIR/install_tools.sh" bash "$LSR_TOX_ENV_TMP_DIR/install_tools.sh" +if [ -d "$DBDIR/python" ]; then + rm -rf $DBDIR/* +fi codeql database init --db-cluster "$DBDIR" --source-root="$TOPDIR" \ --language=python