diff --git a/tcl/submit_files b/tcl/submit_files new file mode 100755 index 00000000..969979a1 --- /dev/null +++ b/tcl/submit_files @@ -0,0 +1,41 @@ +#!/bin/bash + +if [[ ! -d .exercism ]]; then + printf "ERROR: Run from inside a project directory.\n\n" + exit 1 +fi + +# declare package_name_snake + +get_track_package_name() { + # these are kebab-case + basename "${PWD}" +} # get_track_package_name() + +kebab_case_to_pascal_case() { + printf "%s" "${@}" | sed -r -e 's/(^|[-])(\w)/\U\2/g' +} # kebab_case_to_pascal_case() + +kebab_case_to_camel_case() { + printf "%s" "${@}" | sed -r -e 's/([-])(\w)/\U\2/g' +} # kebab_case_to_camel_case() + +kebab_case_to_snake_case() { + printf "%s" "${@}" | sed -r -e 's/(\w)([-])(\w)/\1_\3/g' +} # kebab_case_to_snake_case() + +# package_name_snake="$(kebab_case_to_snake_case "$(get_track_package_name)")" + +declare -a TCL_FILES + +mapfile -t TCL_FILES < <(jq -r '.files.solution[]' .exercism/config.json) +TCL_FILES+=(./run-tests-tcl.txt) + +# mapfile -t TCL_FILES < <( +# find . -type f -name "*[.]go" | grep -v "_test[.]go" +# find . -type f -name "*_examples_test[.]go" +#) + +echo Running: exercism submit "${TCL_FILES[@]}" +time exercism submit "${TCL_FILES[@]}" +printf "\n"