| 1 | #!/bin/bashscip-shell filesystem . . `/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="$(pwdscip-shell system . . pwd.)" |
| 10 | echoscip-shell system . . echo. "pwd=$CWD" |
| 11 | # Create the repo |
| 12 | cd /tmpscip-shell filesystem . . `/tmp`. |
| 13 | reponame=$(datescip-shell system . . date. +gitlint-test-%Y-%m-%d_%H-%M-%S) |
| 14 | gitscip-shell system . . git. init --initial-branch main $reponame |
| 15 | cd $reponame |
| 16 | |
| 17 | # Do some basic config |
| 18 | gitscip-shell system . . git. config user.name gïtlint-test-user |
| 19 | gitscip-shell system . . git. config user.email [email protected] |
| 20 | gitscip-shell system . . git. config core.quotePath false |
| 21 | gitscip-shell system . . git. config core.precomposeUnicode true |
| 22 | |
| 23 | # Add a test commit |
| 24 | echoscip-shell system . . echo. "tëst 123" > test.txt |
| 25 | gitscip-shell system . . git. add test.txt |
| 26 | # commit -m -> use multiple -m args to add multiple paragraphs (/n in strings are ignored) |
| 27 | gitscip-shell system . . 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 | echoscip-shell system . . echo. "" |
| 32 | echoscip-shell system . . echo. -e "Created $GREEN/tmp/${reponame}$NO_COLOR" |
| 33 | echoscip-shell system . . echo. "Hit key up to access 'cd /tmp/$reponame'" |
| 34 | echoscip-shell system . . echo. "(Run this script using 'source' for this to work)" |
| 35 | history -s "cd /tmp/$reponame" |