From a10a9c5c34d252b0afd9566fa34800a502d1fe4e Mon Sep 17 00:00:00 2001 From: austinletson Date: Sat, 23 Nov 2024 07:49:40 -0500 Subject: [PATCH] fix: add logic in config.sh to default to false feature inputs --- scripts/config.sh | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/scripts/config.sh b/scripts/config.sh index d6ddb2f..5433a7f 100755 --- a/scripts/config.sh +++ b/scripts/config.sh @@ -50,21 +50,35 @@ if [ "$LINT" = "true" ]; then fi if [ "$AUTO_CONFIG" = "true" ]; then - # always run `lake build` with `auto-config: true` - echo "auto-config: true" - echo " -> will run lake build" - run_lake_build="true" + if [ "$BUILD" = "false" ]; then + # If the user specifies `build: false`, then do not run `lake build`. + echo "build: false -> will not run lake build" + run_lake_build="true" + else + # `build` input is not `false` and `auto-config: true` + echo "auto-config: true" + echo " -> will run lake build" + run_lake_build="true" + fi - # only run `lake test` with `auto-config: true` if `lake check-test` returns true - if lake check-test; then + if [ "$TEST" = "false" ]; then + # If the user specifies `test: false`, then do not run `lake test`. + echo "test: false -> will not run lake test" + run_lake_test="false" + elif lake check-test; then + # only run `lake test` with `auto-config: true` if `lake check-test` returns true echo "lake check-test succeeded -> will run lake test" run_lake_test="true" else echo "lake check-test failed -> will not run lake test" fi - # only run `lake lint` with `auto-config: true` if `lake check-lint` returns true - if lake check-lint; then + if [ "$LINT" = "false" ]; then + # If the user specifies `lint: false`, then do not run `lake lint`. + echo "lint: false -> will not run lake lint" + run_lake_lint="false" + elif lake check-lint; then + # only run `lake lint` with `auto-config: true` if `lake check-lint` returns true echo "lake check-lint succeeded -> will run lake lint" run_lake_lint="true" else