From 799d0cfd30215a2c83b8910fede625a47f57e3a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Skogstad?= Date: Tue, 14 Jan 2025 19:54:39 +0100 Subject: [PATCH] Remove indentations --- tests/k6/scripts/generate_all_tests.sh | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/k6/scripts/generate_all_tests.sh b/tests/k6/scripts/generate_all_tests.sh index 8721fb010..774df0d3c 100755 --- a/tests/k6/scripts/generate_all_tests.sh +++ b/tests/k6/scripts/generate_all_tests.sh @@ -13,19 +13,20 @@ fi IMPORT_STATEMENTS="" FUNCTION_BODY="" -# Get all *.js files in the directory except for "all-tests.js" for JS_FILE in "$DIRECTORY_PATH"/*.js; do - if [[ $DIRECTORY_PATH != *"/performance/"* ]]; then - BASE_NAME=$(basename "$JS_FILE" .js) + # Skip files in the "performance" directory or the "all-tests.js" file + if [[ $DIRECTORY_PATH == *"/performance/"* ]] || + [[ $(basename "$JS_FILE" .js) == "all-tests" ]]; then + continue + fi - if [[ "$BASE_NAME" != "all-tests" ]]; then - # Append to import strings - IMPORT_STATEMENTS="${IMPORT_STATEMENTS}import { default as ${BASE_NAME} } from './${BASE_NAME}.js';"$'\n' + BASE_NAME=$(basename "$JS_FILE" .js) - # Append to function body - FUNCTION_BODY="${FUNCTION_BODY} ${BASE_NAME}();"$'\n' - fi - fi + # Append to import strings + IMPORT_STATEMENTS="${IMPORT_STATEMENTS}import { default as ${BASE_NAME} } from './${BASE_NAME}.js';"$'\n' + + # Append to function body + FUNCTION_BODY="${FUNCTION_BODY} ${BASE_NAME}();"$'\n' done # Combine all the content