Sha256: 744d374f24b67e1380b20e1d368aa2899c4597f1ed28b2d08dc34c87247471c4

Contents?: true

Size: 881 Bytes

Versions: 33

Compression:

Stored size: 881 Bytes

Contents

#!/bin/bash

if [ -z $1 ]; then
  echo "No exercise slug provided"
  exit 1
fi

tolower() {
  local result=$(echo $1 | tr '[:upper:]' '[:lower:]')
  echo "$result"
}

exercise=$(tolower $1)

if [ -n "$(find exercises -name $exercise -type d -maxdepth 1)" ]; then
  echo "Exercise '$exercise' already exists"
  exit 1
fi

if [ -z "$(find bin -name configlet -type f)" ]; then
  bin/fetch-configlet
fi

if [ -z "$(find .. -name "problem-specifications" -type d -maxdepth 1)" ]; then
  git clone https://github.com/exercism/problem-specifications.git \
    ../problem-specifications
fi

mkdir -p exercises/$exercise/tests

bin/configlet generate . --only $exercise

cp -r template/* exercises/$exercise

echo "Done"
echo "---"
echo "Navigate to 'exercises/$exercise' to start working on '$exercise'"
echo "See the 'Generating Setup' part of contributing to figure out the next steps"

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.179 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.178 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.177 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.176 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.175 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.174 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.173 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.172 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.171 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.170 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.169 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.167 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.166 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.165 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.164 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.163 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.162 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.161 tracks/elm/bin/stub-new-exercise
trackler-2.2.1.160 tracks/elm/bin/stub-new-exercise