summaryrefslogtreecommitdiffstats
path: root/tools/create-test-repo.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2020-03-19 14:00:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2020-03-19 14:00:14 +0000
commitdf9615bac55ac6f1c3f516b66279ac0007175030 (patch)
tree84dd81d1c97835271cea7fbdd67c074742365e07 /tools/create-test-repo.sh
parentInitial commit. (diff)
downloadgitlint-8e8ac75895369b1e6e72db18b29213d1015ac38f.tar.xz
gitlint-8e8ac75895369b1e6e72db18b29213d1015ac38f.zip
Adding upstream version 0.13.1.upstream/0.13.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xtools/create-test-repo.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/tools/create-test-repo.sh b/tools/create-test-repo.sh
new file mode 100755
index 0000000..79934d6
--- /dev/null
+++ b/tools/create-test-repo.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+RED="\033[31m"
+YELLOW="\033[33m"
+BLUE="\033[94m"
+GREEN="\033[32m"
+NO_COLOR="\033[0m"
+
+CWD="$(pwd)"
+echo "pwd=$CWD"
+# Create the repo
+cd /tmp
+reponame=$(date +gitlint-test-%Y-%m-%d_%H-%M-%S)
+git init $reponame
+cd $reponame
+
+# Do some basic config
+git config user.name gïtlint-test-user
+git config user.email gitlint@test.com
+git config core.quotePath false
+git config core.precomposeUnicode true
+
+# Add a test commit
+echo "tëst 123" > test.txt
+git add test.txt
+# commit -m -> use multiple -m args to add multiple paragraphs (/n in strings are ignored)
+git commit -m "test cömmit title" -m "test cömmit body that has a bit more text"
+cd $CWD
+
+# Let the user know
+echo ""
+echo -e "Created $GREEN/tmp/${reponame}$NO_COLOR"
+echo "Hit key up to access 'cd /tmp/$reponame'"
+echo "(Run this script using 'source' for this to work)"
+history -s "cd /tmp/$reponame"