Skip to content

Instantly share code, notes, and snippets.

@thehulke
Created November 14, 2017 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thehulke/9a4a6923b61eddbdd2c6647885968752 to your computer and use it in GitHub Desktop.
Save thehulke/9a4a6923b61eddbdd2c6647885968752 to your computer and use it in GitHub Desktop.
lazy tfs checkin
# 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