Skip to content

Instantly share code, notes, and snippets.

@MilesDowe
Last active August 2, 2018 22:26
Show Gist options
  • Save MilesDowe/097e2f9832c89a4a763697576ea6d9ed to your computer and use it in GitHub Desktop.
Save MilesDowe/097e2f9832c89a4a763697576ea6d9ed to your computer and use it in GitHub Desktop.
RC function for creating work ticket notes
# Add to .bashrc or similar runcommand file
function ticket() {
FILE=${1}.txt
FILE_LOC=~/Desktop/${1}.txt
# Check if file exists
stat ${FILE_LOC} > /dev/null 2>&1
EXISTS=$?
# If not, add header
if [[ EXISTS -ne 0 ]]; then
echo "# Ticket ${1} Notes" >> ${FILE_LOC}
echo "Created: $(date)" >> ${FILE_LOC}
echo "Author : Miles Dowe" >> ${FILE_LOC}
echo "Sprint : ####.##.##" >> ${FILE_LOC}
echo "" >> ${FILE_LOC}
echo "## Development Steps" >> ${FILE_LOC}
echo "" >> ${FILE_LOC}
echo "## Questions & Concerns" >> ${FILE_LOC}
echo "" >> ${FILE_LOC}
fi
vi ${FILE_LOC}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment