]> Shamusworld >> Repos - ardour-manual-diverged/blob - doit
Transition commit as per discussion with rgareus.
[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 symlink (this is temporary!)
15 if [ ! -e "include/_manual" ]; then
16   ln -s ../_manual/ include/_manual
17 fi
18
19 # create the required folders if need be, or empties them
20 if [ ! -d "_site" ]; then
21   mkdir _site
22 else
23         rm -rf _site/*
24 fi
25
26 if [ ! -d "_manual.munge" ]; then
27   mkdir _manual.munge
28 else
29   rm -rf _manual.munge/*
30 fi
31
32 rm -rf _build/* && \
33 ./munge && \
34 ./build.rb 
35 chmod -R a+rx _site
36
37 # if a target directory exists, copy the site there
38 if [ ! -z "$DIRHTML" ]
39 then
40   rm -rf "$DIRHTML/*"
41   cp -R _site/* "$DIRHTML/"
42 fi
43