2016-09-05 19:34:27 -04:00
|
|
|
#
|
|
|
|
# zim_info - easily create an issue template
|
|
|
|
#
|
|
|
|
|
|
|
|
# create our 'pause' function
|
|
|
|
waiter_func() {
|
|
|
|
local input_key
|
|
|
|
read -sk \?"Press [Enter] to continue; anything else to quit." input_key
|
|
|
|
if [[ ${input_key} == $'\n' ]]; then
|
|
|
|
print "\r "
|
|
|
|
return 0
|
|
|
|
else
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# print init dialog
|
|
|
|
print "Please check the existing issues to make sure you\'re not duplicating a report"
|
2018-01-01 07:58:41 -05:00
|
|
|
print "https://github.com/zimfw/zimfw/issues"
|
2016-09-05 19:34:27 -04:00
|
|
|
|
|
|
|
# if they don't accept, bail
|
|
|
|
if ! waiter_func; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# for convenience, this is our new home
|
2017-06-10 19:54:22 -04:00
|
|
|
cd ${ZIM_HOME}
|
2016-09-05 19:34:27 -04:00
|
|
|
|
|
|
|
# collect sys info
|
2017-10-23 10:33:57 -04:00
|
|
|
local git_dirty=$(command git status --porcelain 2>/dev/null | tail -n1)
|
|
|
|
local zim_info=$(zsh tools/zim_info)
|
2016-09-05 19:34:27 -04:00
|
|
|
|
2017-10-23 10:33:57 -04:00
|
|
|
print "Environment Info
|
|
|
|
----------------
|
|
|
|
${zim_info}
|
2016-09-05 19:34:27 -04:00
|
|
|
|
2017-10-23 10:33:57 -04:00
|
|
|
Description
|
|
|
|
-----------
|
|
|
|
${user_desc}
|
2016-09-05 19:34:27 -04:00
|
|
|
|
2017-10-23 10:33:57 -04:00
|
|
|
Steps to Reproduce
|
|
|
|
------------------
|
|
|
|
${user_reproduce}
|
2016-09-05 19:34:27 -04:00
|
|
|
|
2017-10-23 10:33:57 -04:00
|
|
|
Images or other Information
|
|
|
|
---------------------------
|
|
|
|
"
|
2016-09-05 19:34:27 -04:00
|
|
|
|
|
|
|
|
|
|
|
# if we have a dirty git, report it
|
|
|
|
if [[ -n ${git_dirty} ]]; then
|
2017-06-10 19:54:22 -04:00
|
|
|
print "${ZIM_HOME} has a dirty git working tree."
|
2016-09-05 19:34:27 -04:00
|
|
|
print "here is the diff:"
|
|
|
|
print '```'
|
|
|
|
print $(command git diff)
|
|
|
|
print '```'
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
print '\n\n'
|
2016-09-06 16:10:47 -04:00
|
|
|
print 'Please copy the above and use this when reporting the issue\n'
|
|
|
|
|
|
|
|
# optionally, now we can produce debug info
|
|
|
|
print 'If you would like to produce some helpful logs about your environment, run:'
|
|
|
|
print '$ zmanage debug'
|