Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions dotnet/tcr
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

set -o nounset

test_code() {
dotnet test
}

main() {
test_code

if [[ $? -eq 0 ]]; then
git add . && git commit -m "$1"
echo "Go ahead!"
else
echo "Tests failed, reverting..."
git reset --hard
fi
}

if [[ $# -ne 1 ]]; then
echo "Usage: tcr \"commit message\""
exit 1
fi

main "$1"
25 changes: 25 additions & 0 deletions dotnet/tdd
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

set -o nounset

test_code() {
dotnet test
}

main() {
test_code

if [[ $? -eq 0 ]]; then
git add . && git commit -m "$1"
echo "Go ahead!"
else
echo "Tests failed"
fi
}

if [[ $# -ne 1 ]]; then
echo "Usage: tdd \"commit message\""
exit 1
fi

main "$1"