| 1 | #!/bin/bash |
| 2 | |
| 3 | RED="\033[31m" |
| 4 | YELLOW="\033[33m" |
| 5 | BLUE="\033[94m" |
| 6 | GREEN="\033[32m" |
| 7 | NO_COLOR="\033[0m" |
| 8 | |
| 9 | CWD="$(pwd)" |
| 10 | echo "pwd=$CWD" |
| 11 | # Create the repo |
| 12 | cd /tmp |
| 13 | reponame=$(date +gitlint-test-%Y-%m-%d_%H-%M-%S) |
| 14 | git init --initial-branch main $reponame |
| 15 | cd $reponame |
| 16 | |
| 17 | # Do some basic config |
| 18 | git config user.name gïtlint-test-user |
| 19 | git config user.email [email protected] |
| 20 | git config core.quotePath false |
| 21 | git config core.precomposeUnicode true |
| 22 | |
| 23 | # Add a test commit |
| 24 | echo "tëst 123" > test.txt |
| 25 | git add test.txt |
| 26 | # commit -m -> use multiple -m args to add multiple paragraphs (/n in strings are ignored) |
| 27 | git commit -m "test cömmit title" -m "test cömmit body that has a bit more text" |
| 28 | cd $CWD |
| 29 | |
| 30 | # Let the user know |
| 31 | echo "" |
| 32 | echo -e "Created $GREEN/tmp/${reponame}$NO_COLOR" |
| 33 | echo "Hit key up to access 'cd /tmp/$reponame'" |
| 34 | echo "(Run this script using 'source' for this to work)" |
| 35 | history -s "cd /tmp/$reponame" |