Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add simple script to verify presence of exercise directories #12

Merged
merged 1 commit into from

2 participants

@michaelavila

This is a very simple first step towards a solution to issue #6. Right now this works from x-api once you've init and update your submodules. It simply checks that each exercise listed has a corresponding directory present. If it doesn't it outputs some text to stderr and exits 1. I'm sure there is a lot more we can do here, but again, this might be a start. Let me know what you think.

@kytrinyx
Owner

This is exactly what I was thinking, thank you!

@kytrinyx kytrinyx merged commit 4c5b41c into exercism:master

1 check failed

Details default The Travis CI build is in progress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 25 additions and 0 deletions.
  1. +25 −0 bin/verify_exercises_exist
View
25 bin/verify_exercises_exist
@@ -0,0 +1,25 @@
+#!/bin/bash
+
+ROOT=$(pwd)
+
+for language in $(ls exercises)
+do
+ cd exercises/$language
+ while read exercise;
+ do
+ # ignore comments and empty lines
+ initial="$(echo $exercise | head -c 1)"
+ if [ "$initial" == "#" ] || [ "$initial" == "" ]; then
+ continue;
+ fi
+
+ # fail if exercise directory does not exist
+ if [ ! -d "$exercise" ]; then
+ echo "$exercise not found for language $language" 1>&2
+ echo " -one possibility is that you haven't run:" 1>&2
+ echo " $ git submodule init && git submodule update" 1>&2
+ exit 1
+ fi
+ done < EXERCISES.txt
+ cd $ROOT
+done
Something went wrong with that request. Please try again.