Sha256: f9e2071f672fcb57f311bd71a2bc31b7aa7c49905d303153ed09cf240341627c

Contents?: true

Size: 1.94 KB

Versions: 38

Compression:

Stored size: 1.94 KB

Contents

#!/usr/bin/env bash

# FORMAT

echo '-------------------------------------------------------'
echo "Checking Formatting"

which elm-format > /dev/null

if [ $? -ne 0 ]; then
  echo "elm-format not found"
  exit 1
fi

elm-format --yes --validate exercises/**/*{.example,Tests.elm}

if [ $? -ne 0 ]; then
    echo "*******************************************************************"
    echo "*******************************************************************"
    echo "**                       elm-format failed                       **"
    echo "**        perhaps some of your changes are not formatted?        **"
    echo "**             Please run elm-format before pushing.             **"
    echo "*******************************************************************"
    echo "*******************************************************************"
    exit 1
else
  echo "formatting looks good!"
fi


# TEST

declare -i TEST_RESULT=0
FAILED_EXERCISES=''

for example_file in exercises/**/*.example
do
  exercise_dir=$(dirname $example_file)
  exercise=$(basename $example_file .example)
  mv "$exercise_dir/$exercise.elm" "$exercise_dir/$exercise.impl"
  mv "$exercise_dir/$exercise.example" "$exercise_dir/$exercise.elm"
  echo '-------------------------------------------------------'
  echo "Testing $exercise"

  # prevent elm-test from installing dependencies
  mv $exercise_dir/elm-package.json $exercise_dir/elm-package.json.disabled

  elm-test $exercise_dir/*Tests.elm

  # capture result from last command (elm-test)
  if [ $? -ne 0 ]; then
      TEST_RESULT=1
      FAILED_EXERCISES+="$exercise\n"
  fi

  # be kind, rewind
  mv $exercise_dir/elm-package.json.disabled $exercise_dir/elm-package.json
  mv "$exercise_dir/$exercise.elm" "$exercise_dir/$exercise.example"
  mv "$exercise_dir/$exercise.impl" "$exercise_dir/$exercise.elm"
done

if [ $TEST_RESULT -ne 0 ]; then
  echo "The following exercises failed"
  printf $FAILED_EXERCISES
  exit $TEST_RESULT
fi

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
trackler-2.0.5.1 tracks/elm/bin/build.sh
trackler-2.0.5.0 tracks/elm/bin/build.sh
trackler-2.0.4.0 tracks/elm/bin/build.sh
trackler-2.0.3.9 tracks/elm/bin/build.sh
trackler-2.0.3.8 tracks/elm/bin/build.sh
trackler-2.0.3.7 tracks/elm/bin/build.sh
trackler-2.0.3.6 tracks/elm/bin/build.sh
trackler-2.0.3.5 tracks/elm/bin/build.sh
trackler-2.0.3.4 tracks/elm/bin/build.sh
trackler-2.0.3.3 tracks/elm/bin/build.sh
trackler-2.0.3.2 tracks/elm/bin/build.sh
trackler-2.0.3.1 tracks/elm/bin/build.sh
trackler-2.0.3.0 tracks/elm/bin/build.sh
trackler-2.0.2.0 tracks/elm/bin/build.sh
trackler-2.0.1.2 tracks/elm/bin/build.sh
trackler-2.0.1.1 tracks/elm/bin/build.sh
trackler-2.0.1.0 tracks/elm/bin/build.sh
trackler-2.0.0.10 tracks/elm/bin/build.sh
trackler-2.0.0.9 tracks/elm/bin/build.sh
trackler-2.0.0.8 tracks/elm/bin/build.sh