Skip to content

Commit

Permalink
Add create_archive.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
aminophen committed Sep 3, 2016
1 parent 0b4b36e commit e136519
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ by running platex on the .dtx files.

## Release Date

2016-09-03
$RELEASEDATE

Haruhiko Okumura,
Japanese TeX Development Community
52 changes: 52 additions & 0 deletions create_archive.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/sh

PROJECT=jsclasses
TMP=/tmp
PWDF=`pwd`
LATESTRELEASEDATE=`git tag | sort -r | head -n 1`
RELEASEDATE=`git tag --points-at HEAD | sort -r | head -n 1`

if [ -z "$RELEASEDATE" ]; then
RELEASEDATE="**not tagged**; later than $LATESTRELEASEDATE?"
fi

echo " * Create $PROJECT.tds.zip"
git archive --format=tar --prefix=$PROJECT/ HEAD | (cd $TMP && tar xf -)
rm $TMP/$PROJECT/.gitignore
rm $TMP/$PROJECT/create_archive.sh
perl -pi.bak -e "s/\\\$RELEASEDATE/$RELEASEDATE/g" $TMP/$PROJECT/README.md
rm -f $TMP/$PROJECT/README.md.bak

mkdir -p $TMP/$PROJECT/doc/platex/jsclasses
mv $TMP/$PROJECT/LICENSE $TMP/$PROJECT/doc/platex/jsclasses/
mv $TMP/$PROJECT/README.md $TMP/$PROJECT/doc/platex/jsclasses/
mv $TMP/$PROJECT/*.pdf $TMP/$PROJECT/doc/platex/jsclasses/

mkdir -p $TMP/$PROJECT/source/platex/jsclasses
mv $TMP/$PROJECT/Makefile $TMP/$PROJECT/source/platex/jsclasses/
mv $TMP/$PROJECT/*.dtx $TMP/$PROJECT/source/platex/jsclasses/
mv $TMP/$PROJECT/*.ins $TMP/$PROJECT/source/platex/jsclasses/

mkdir -p $TMP/$PROJECT/tex/platex/jsclasses
mv $TMP/$PROJECT/*.cls $TMP/$PROJECT/tex/platex/jsclasses/
mv $TMP/$PROJECT/*.sty $TMP/$PROJECT/tex/platex/jsclasses/

cd $TMP/$PROJECT && zip -r $TMP/$PROJECT.tds.zip *
cd $PWDF
rm -rf $TMP/$PROJECT

echo
echo " * Create $PROJECT.zip ($RELEASEDATE)"
git archive --format=tar --prefix=$PROJECT/ HEAD | (cd $TMP && tar xf -)
# Remove generated and auxiliary files
rm $TMP/$PROJECT/.gitignore
rm $TMP/$PROJECT/create_archive.sh
rm $TMP/$PROJECT/*.cls
ls $TMP/$PROJECT/*.sty | grep -v minijs.sty | xargs rm
perl -pi.bak -e "s/\\\$RELEASEDATE/$RELEASEDATE/g" $TMP/$PROJECT/README.md
rm -f $TMP/$PROJECT/README.md.bak

cd $TMP && zip -r $PWDF/$PROJECT.zip $PROJECT $PROJECT.tds.zip
rm -rf $TMP/$PROJECT $TMP/$PROJECT.tds.zip
echo
echo " * Done: $PROJECT.zip ($RELEASEDATE)"

0 comments on commit e136519

Please sign in to comment.