Skip to content

Instantly share code, notes, and snippets.

@ErikSchierboom
Last active January 17, 2023 08:16
Show Gist options
  • Save ErikSchierboom/006f5d25ee1a0b86be449103c5177bb5 to your computer and use it in GitHub Desktop.
Save ErikSchierboom/006f5d25ee1a0b86be449103c5177bb5 to your computer and use it in GitHub Desktop.
Script to submit exercism exercise
#!/usr/bin/env bash
exercise=$(echo $PWD | awk -F/ '{print $(NF)}')
track=$(echo $PWD | awk -F/ '{print $(NF-1)}')
if [[ $(git ls-files --error-unmatch README.md 2> /dev/null) ]]; then
type="iteration"
else
type="solution"
fi
exercism submit
git add .
git commit -m "${track}/${exercise}: add ${type}"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment