| Server IP : 68.183.124.220 / Your IP : 216.73.217.137 Web Server : Apache/2.4.18 (Ubuntu) System : Linux Sandbox-A 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : gavin ( 1000) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/gavin/workspace/happymandarin/node_modules/node-inspector/tools/ |
Upload File : |
#!/bin/bash
FILE=""
NULL="/dev/null"
LIST=false
TAG=$(node -e "console.log(require('./package.json').version)")
tmp="$TMPDIR/changelog"
if [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
NULL="NUL";
tmp="._changelog"
fi
while [ "$1" != "" ]; do
case $1 in
-l | --list )
LIST=true
;;
-t | --tag )
TAG=$2
shift
;;
* )
FILE=$1
;;
esac
shift
done
DATE=`date +'%Y-%m-%d'`
HEAD="## $DATE, Version $TAG\n\n"
if $LIST; then
printf "$HEAD"
lasttag=$(git rev-list --tags --max-count=1 2>$NULL)
version=$(git describe --tags --abbrev=0 $lasttag 2>$NULL)
export GIT_PAGER=cat # disable pager when running interactively
if test -z "$version"; then
git log --no-merges --pretty="format: * %s (%an)%n"
else
git log --no-merges --pretty="format: * %s (%an)%n" $version..
fi
exit
fi
CHANGELOG=$FILE
if test "$CHANGELOG" = ""; then
CHANGELOG=`ls | egrep 'change|history' -i|head -n1`
if test "$CHANGELOG" = ""; then
CHANGELOG='History.md';
fi
fi
$0 --list >> $tmp
printf '\n' >> $tmp
if [ -f $CHANGELOG ]; then echo "" >> $tmp; cat $CHANGELOG >> $tmp; fi
mv $tmp $CHANGELOG
test -n "$EDITOR" && $EDITOR $CHANGELOG