Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added checks if directories exist #35

Merged
merged 1 commit into from

2 participants

@qbi

No description provided.

@pettter pettter merged commit bd65b5c into cryptoparty:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 30, 2012
  1. @qbi

    Added checks if directories exist

    qbi authored
This page is out of date. Refresh to see the latest.
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/convert_to_tex.sh
View
9 src/convert_to_tex.sh
@@ -4,7 +4,10 @@ if [ -z $1 ] ; then
else
DIR=$1
fi
-mkdir $DIR
+
+if [ ! -d $DIR ] ; then
+ mkdir $DIR
+fi
cat > $DIR/main.tex <<EOF
\documentclass[oribibl,a4paper]{book}
@@ -31,7 +34,9 @@ EOF
for d in chapter*; do
- mkdir $DIR/$d
+ if [ ! -d $DIR/$d ] ; then
+ mkdir $DIR/$d
+ fi
echo "\\graphicspath{{./$d/}}" >> $DIR/main.tex
title=`echo $d | sed 's/chapter_[0-9][0-9]_//; s/_/ /g; s/^./\U&/; s/ ./\U&/g'`
echo "\\chapter{$title}" >> $DIR/main.tex
Something went wrong with that request. Please try again.