]> Shamusworld >> Repos - ardour-manual-diverged/blob - doit
Sync to master.
[ardour-manual-diverged] / doit
1 #!/bin/sh
2 #
3 # Simple shell script to do all the steps that need doing
4 #
5
6 # if a parameter exists, that's where the website is copied after generation
7 if [ -n "$1" ]
8 then
9   DIRHTML=$(echo "$1"|sed 's/\/$//g'); #strips the trailing slash if need be
10 else
11   DIRHTML="";
12 fi
13
14 # Create required binaries
15 if [ ! -e "munge" ]; then
16   gcc munge.cpp -o munge -lstdc++ -g
17 fi
18
19 # Create required symlink (this is temporary!)
20 if [ ! -e "include/_manual" ]; then
21   ln -s ../_manual/ include/_manual
22 fi
23
24 # create the required folders if need be, or empties them
25 if [ ! -d "_site" ]; then
26   mkdir _site
27 else
28         rm -rf _site/*
29 fi
30
31 if [ ! -d "_manual.munge" ]; then
32   mkdir _manual.munge
33 else
34   rm -rf _manual.munge/*
35 fi
36
37 rm -rf _build/* && \
38 ./munge && \
39 ./build.rb 
40 chmod -R a+rx _site
41
42 # if a target directory exists, copy the site there
43 if [ ! -z "$DIRHTML" ]
44 then
45   rm -rf "$DIRHTML/*"
46   cp -R _site/* "$DIRHTML/"
47 fi
48