comparison iReport.sh @ 0:ac5f9272033b draft

first upload
author saskia-hiltemann
date Tue, 01 Jul 2014 11:42:23 -0400
parents
children 440f4aa3db97
comparison
equal deleted inserted replaced
-1:000000000000 0:ac5f9272033b
1 #!/bin/bash
2 repositorypath="/mnt/galaxyTools/shed_tools/toolshed.nbic.nl/repos/saskia-hiltemann/ireport/71dc132e9bb2/ireport" # TODO: dependency
3 source "${repositorypath}/createHTML.sh"
4
5 echo "allparams: $@"
6 function usage() { echo "Oops!"; }
7
8
9 # set some defaults
10
11
12 set -- `getopt -n$0 -u -a --longoptions="ifusepath: galaxypath: tab: item: htmlout: label: toolpath: minwidth: coverimage:" "h:" "$@"` || usage
13 [ $# -eq 0 ] && usage
14
15 while [ $# -gt 0 ]
16 do
17 case "$1" in
18 --toolpath) repositorypath=$2;shift;;
19 --galaxypath) galaxypath=$2;shift;;
20 --minwidth) minwidth=$2;shift;;
21 --tab) tabs+=",$2";shift;;
22 --item) items+=",$2";shift;;
23 --htmlout) htmlout=$2;shift;;
24 --label) title="$@";shift;;
25 --coverimage) coverimage=$2;shift;;
26 -h) shift;;
27 --) shift;break;;
28 -*) usage;;
29 *) break;;
30 esac
31 shift
32 done
33
34
35 mkdir $galaxypath
36
37 tabs=${tabs//,/ }; tabs=${tabs/ /}
38 items=${items//,/ }; items=${items/ /}
39 title=${title//--/}
40 title=${title//label/}
41 echo -e "\n"
42 echo -e "title: $title"
43 echo -e "tabs: $tabs"
44 echo -e "items: $items"
45 echo -e "htmlout: $htmlout"
46 echo -e "coverimage: $coverimage"
47 echo -e "\n"
48
49 for i in $tabs
50 do
51 echo "tabname: $i"
52 done
53
54 coverimage=${coverimage:1}
55 echo -e "coverimage2: $coverimage"
56
57 #if no coverimage provided, use default EMC logo
58 if [[ -z $coverimage ]]
59 then
60 cp $repositorypath/intro.jpg ${galaxypath}/intro.jpg
61 coverimage="intro.jpg"
62 fi
63 echo -e "coverimage3: $coverimage"
64
65 ## Copy supporting files to output directory
66 cp ${repositorypath}/jquery.dataTables.css ${galaxypath}/jquery.dataTables.css
67 cp ${repositorypath}/jquery.dataTables.js ${galaxypath}/jquery.dataTables.js
68 cp -R ${repositorypath}/iframe-resizer/ ${galaxypath}/iframe-resizer/
69 cp -R ${repositorypath}/DataTables-1.9.4/ ${galaxypath}/DataTables-1.9.4/
70 cp ${repositorypath}/jquery.zoom.js ${galaxypath}/jquery.zoom.js
71
72
73 echo "done copying resource files"
74 ls ${galaxypath}
75
76
77 ## Create cover HTML page
78 makeIntroPage "$title" $coverimage "report.html" $htmlout
79
80 ## Create Report page with tabs
81 createMainPage ${galaxypath}/report.html "$tabs" "$items" $minwidth
82