Last active
April 14, 2016 06:01
-
-
Save arthurafarias/ce19fbe1c6080050cf0b37c38734ccc8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
curl https://cdn.rawgit.com/arthurafarias/a88aa1c2dc075b32284549316e5a0a74/raw/3845e63a77486240d68da62afa744d5127b34540/.texlipse > .texlipse | |
curl https://cdn.rawgit.com/arthurafarias/ea7d426d13012f12701766d07b6fc34a/raw/959b0331b9375e2d0a6f47a05275369cebaff0e8/.project > .project | |
while [ -z $PRJ_NAME ] | |
do | |
echo "Type project name: "; | |
read PRJ_NAME | |
done | |
echo "Type project comment: "; read PRJ_COMMENT | |
while [ -z $PRJ_OUTPUTDIR ] | |
do | |
echo "Type output directory name [Build]:"; read PRJ_OUTPUTDIR | |
if [ -z $PRJ_OUTPUTDIR ] | |
then | |
PRJ_OUTPUTDIR="Build" | |
fi | |
done | |
while [ -z $PRJ_OUTPUTFORMAT ] | |
do | |
echo "Type output format [pdf]:"; read PRJ_OUTPUTFORMAT | |
if [ -z $PRJ_OUTPUTFORMAT ] | |
then | |
PRJ_OUTPUTFORMAT="pdf" | |
fi | |
done | |
while [ -z $PRJ_TEMPDIR ] | |
do | |
echo "Type temprary directory name [Tmp]:"; read PRJ_TEMPDIR | |
if [ -z $PRJ_TEMPDIR ] | |
then | |
PRJ_TEMPDIR="Tmp" | |
fi | |
done | |
while [ -z $PRJ_MAINTEXFILE ] | |
do | |
echo "Type main .tex file name [main.tex]:"; read PRJ_MAINTEXFILE | |
if [ -z $PRJ_MAINTEXFILE ] | |
then | |
PRJ_MAINTEXFILE="main.tex" | |
fi | |
done | |
while [ -z $PRJ_OUTPUTFILE ] | |
do | |
echo "Type output file name[main.$PRJ_OUTPUTFORMAT]:"; read PRJ_OUTPUTFILE | |
if [ -z $PRJ_OUTPUTFILE ] | |
then | |
PRJ_OUTPUTFILE="main.$PRJ_OUTPUTFORMAT" | |
fi | |
done | |
while [ -z $PRJ_LANGSPELL ] | |
do | |
echo "Type language spell in this project [br]:"; read PRJ_LANGSPELL | |
if [ -z $PRJ_LANGSPELL ] | |
then | |
PRJ_LANGSPELL="br" | |
fi | |
done | |
perl -0777 -i -pe "s/<projectDescription>\n\t<name>.*<\/name>\n\t<comment>/<projectDescription>\n\t<name>$PRJ_NAME<\/name>\n\t<comment>$PRJ_COMMENT/igs" .project | |
perl -0777 -i -pe "s/outputDir=.*/outputDir=$PRJ_OUTPUTDIR/" .texlipse | |
perl -0777 -i -pe "s/makeIndSty=.*/makeIndSty=$PRJ_MAKEINDSTY/" .texlipse | |
perl -0777 -i -pe "s/bibrefDir=.*/bibrefDir=$PRJ_BIBREFDIR/" .texlipse | |
perl -0777 -i -pe "s/outputFormat=.*/outputFormat=$PRJ_OUTPUTFORMAT/" .texlipse | |
perl -0777 -i -pe "s/tempDir=.*/tempDir=$PRJ_TEMPDIR/" .texlipse | |
perl -0777 -i -pe "s/mainTexFile=.*/mainTexFile=$PRJ_MAINTEXFILE/" .texlipse | |
perl -0777 -i -pe "s/outputFile=.*/outputFile=$PRJ_OUTPUTFILE/" .texlipse | |
perl -0777 -i -pe "s/langSpell=.*/langSpell=$PRJ_LANGSPELL/" .texlipse | |
echo "Done!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment