-
Notifications
You must be signed in to change notification settings - Fork 15
/
changelog.sh
17 lines (14 loc) · 659 Bytes
/
changelog.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#! /bin/bash
zen_bin=$(find /usr/{bin,local/bin} -name zenity)
qa_message="IMPORTANT NOTICE\nWill you display changelog ?"
last_change=$(cat CHANGELOG.md | sed -n "/^\(### Change Log\)/,/^\(\s*\)$/p")
if ! [[ $zen_bin ]]; then
echo -e "### Zenity is required to display changelog message with a graphical interface.\nPlease, install it first with your default package manager to get it at next 'make' launch.\n"
echo -e "$last_change"
else
$zen_bin --width=200 --title='Last Change Log' --question --text="$qa_message"
if [ $? = 0 ]; then
(printf "$last_change")|$zen_bin --width=520 --height=360 --title='Last Change Log' --text-info
fi
fi
exit 0