File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # Synopsis:
4
+ # Update an exercise
5
+
6
+ # Example:
7
+ # bin/update-practice-exercise two-fer
8
+
9
+ set -euo pipefail
10
+ scriptname=$0
11
+
12
+ help_and_exit () {
13
+ echo >&2 " Update a practice exercise."
14
+ echo >&2 " Usage: ${scriptname} <exercise-slug>"
15
+ exit 1
16
+ }
17
+
18
+ die () { echo >&2 " $* " ; exit 1; }
19
+
20
+ [[ -f ./bin/fetch-configlet ]] || die " Run this script from the repo's root directory."
21
+
22
+ (( $# >= 1 )) || help_and_exit
23
+
24
+ slug=" ${1} "
25
+
26
+ ./bin/fetch-configlet
27
+ ./bin/configlet sync --tests include --metadata --filepaths --exercise " ${slug} " --update --yes
28
+
29
+ generator_tpl_file=" exercises/practice/${slug} /.meta/generator.tpl"
30
+
31
+ if [[ -f " ${generator_tpl_file} " ]]; then
32
+ ./bin/generate-tests " ${slug} "
33
+ ./bin/verify-exercises " ${slug} "
34
+ fi
You can’t perform that action at this time.
0 commit comments