Mercurial > hg > soundsoftware-site
comparison extra/soundsoftware/extract-matlabdocs.sh @ 524:1248a47e81b3 feature_36
Merge from branch "luisf"
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Mon, 25 Jul 2011 14:39:38 +0100 |
parents | e7ba81c8dc5a |
children |
comparison
equal
deleted
inserted
replaced
519:3be6bc3c2a17 | 524:1248a47e81b3 |
---|---|
1 #!/bin/bash | |
2 | |
3 docdir="/var/doc" | |
4 | |
5 progdir=$(dirname $0) | |
6 case "$progdir" in | |
7 /*) ;; | |
8 *) progdir="$(pwd)/$progdir" ;; | |
9 esac | |
10 | |
11 project="$1" | |
12 projectdir="$2" | |
13 targetdir="$3" | |
14 | |
15 if [ -z "$project" ] || [ -z "$targetdir" ] || [ -z "$projectdir" ]; then | |
16 echo "Usage: $0 <project> <projectdir> <targetdir>" | |
17 exit 2 | |
18 fi | |
19 | |
20 if [ ! -d "$projectdir" ]; then | |
21 echo "Project directory $projectdir not found" | |
22 exit 1 | |
23 fi | |
24 | |
25 if [ ! -d "$targetdir" ]; then | |
26 echo "Target dir $targetdir not found" | |
27 exit 1 | |
28 fi | |
29 | |
30 if [ -f "$targetdir/index.html" ]; then | |
31 echo "Target dir $targetdir already contains index.html" | |
32 exit 1 | |
33 fi | |
34 | |
35 mfile=$(find "$projectdir" -type f -name \*.m -print0 | xargs -0 grep -l '^% ' | head -1) | |
36 | |
37 if [ -z "$mfile" ]; then | |
38 echo "No MATLAB files with comments found for project $project" | |
39 exit 1 | |
40 fi | |
41 | |
42 echo "Project $project contains at least one MATLAB file with comments" | |
43 | |
44 cd "$projectdir" || exit 1 | |
45 | |
46 perl "$progdir/matlab-docs.pl" -c "$progdir/matlab-docs.conf" -d "$targetdir" | |
47 |