Browse Source

fix sed syntax

master
Bernie Hoeneisen 3 years ago
parent
commit
6c19dafbff
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      misc/scripts/housekeeping.sh

+ 7
- 7
misc/scripts/housekeeping.sh View File

@ -65,8 +65,8 @@ fi
## Get essentials from Makefile
echo
echo "Verify docname and revision..."
revision=`egrep -e "REV\s*\:\=" Makefile | cut -f 2 -d\= | sed 's/[\t\w ]*//g'`
docname=`egrep -e "NAME\s*\:\=" Makefile | cut -f 2 -d\= | sed 's/[\t\w ]*//g'`
revision=`egrep -e "REV\s*\:\=" Makefile | cut -f 2 -d\= | sed 's/[ ]*//g'`
docname=`egrep -e "NAME\s*\:\=" Makefile | cut -f 2 -d\= | sed 's/[ ]*//g'`
new_revision=0$((10#$revision+1)) # 10 for decimal interpretation
new_revision=${new_revision: -2} # only for case if revsion >= 10
@ -135,17 +135,16 @@ fi
## Archive documents
echo "Move documents to archive folder and add them to repository..."
echo "Move documents to archive folder..."
mkdir -p $arch
mv $filename_xml $filename_txt $filename_html $arch
hg add $arch/$filename_xml $arch/$filename_txt $arch/$filename_html
## Rename Version in mkd and Makefile
echo
echo "Renaming version in mkd and Makefile..."
sed -i -e "s/docname\:[\t\w ]*$docname-$revision[\t\w ]*/docname\:\ $docname-$new_revision/g" $filename_mkd
sed -i -e "s/REV[\t\w ]*\:\=[\t\w ]*$revision[\t\w ]*/REV\ \:\=\ $new_revision/g" Makefile
sed -i -e "s/docname\:[ ]*$docname-$revision[ ]*/docname\:\ $docname-$new_revision/g" $filename_mkd
sed -i -e "s/REV[ ]*\:\=[ ]*$revision[ ]*/REV\ \:\=\ $new_revision/g" Makefile
echo "Making diff..."
hg diff $filename_mkd Makefile
@ -182,10 +181,11 @@ read -ep "Do you want to commit the changes to the repository? (Y/n) ";
if [[ $REPLY != "Y" ]] && [[ $REPLY != "y" ]]; then
echo "Aborting..."
echo "Please commit / push manually."
echo "Please add / commit / push manually."
exit
fi
hg add $arch/$filename_xml $arch/$filename_txt $arch/$filename_html
hg commit -m "new revision published / housekeeping" $filename_mkd Makefile $arch/$filename_xml $arch/$filename_txt $arch/$filename_html
hg push


Loading…
Cancel
Save