Created
November 14, 2017 14:45
-
-
Save thehulke/9a4a6923b61eddbdd2c6647885968752 to your computer and use it in GitHub Desktop.
lazy tfs checkin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Allows to chekin TFS files and associate them to a workItem if needed. | |
function lazytf() { | |
while(true) | |
do | |
clear | |
read -p "Checkin comment: " checkinComment | |
printf "Do you want to associate a workItem? [y]/[n] \n" | |
printf "#######################################\n" | |
read -p "Your Choice: " choice | |
case $choice in | |
[yY]) | |
read -p "workItem id: " workItemId | |
doCheckIn "'$checkinComment'" $workItemId | |
return 1 | |
;; | |
[nN]) | |
doCheckIn "'$checkinComment'" | |
return 1 | |
;; | |
*) | |
esac | |
done | |
} | |
doCheckIn() { | |
echo "$*" | |
if [ -z "$2" ] | |
then | |
echo "doing tf checkin -comment:$1" | |
tf checkin -comment:"$1" | |
else | |
echo "doing tf checkin -comment:$1 -associate:$2" | |
tf checkin -comment:"$1" -associate:$2 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment