Crombie Tools
workspace.sh
Go to the documentation of this file.
1 #!/bin/bash
2 
3 full=$1
4 
5 testDir="test"
6 
7 # Overwrite
8 CROMBIEPATH=$CROMBIEPATH/old
9 
10 for dir in `ls $CROMBIEPATH/templates`
11 do
12 
13  # Ignore the files directly in the templates directory
14  if [ -f $CROMBIEPATH/templates/$dir ]
15  then
16  continue
17  fi
18 
19  # Make a local directory if needed
20  if [ ! -d $dir ]
21  then
22  mkdir $dir
23  fi
24 
25  if [ "$full" = "test" ]
26  then
27  for testFile in `ls $CROMBIEPATH/templates/$dir/$testDir`
28  do
29  if [ ! -f $dir/$testFile ]
30  then
31  cp $CROMBIEPATH/templates/$dir/$testDir/$testFile $dir/$testFile
32  fi
33  done
34  fi
35 
36  for file in `ls $CROMBIEPATH/templates/$dir`
37  do
38  if [ "$file" = "$testDir" ]
39  then
40  continue
41  fi
42 
43  if [ ! -f $dir/$file ]
44  then
45  cp $CROMBIEPATH/templates/$dir/$file $dir/$file
46  fi
47 
48  done
49 done
50 
51 location=`pwd`
52 
53 if [ ! -f docs/${location##*/}.tex ]
54 then
55  mv docs/results.tex docs/${location##*/}.tex
56 else
57  rm docs/results.tex
58 fi
59 
60 if [ ! -d docs/figs ]
61 then
62  mkdir docs/figs
63 fi