@@ -74,7 +74,7 @@ while :; do
74
74
-h|--help) help ;;
75
75
-v|--version) force_version; exit 0;;
76
76
-i|--info) echo " Generate Level 2 processing report" ; exit 0;;
77
- -o|--output) OUTPUT =" $2 " ; shift ;;
77
+ -o|--output) OUTREPORT =" $2 " ; shift ;;
78
78
-- ) shift ; break ;;
79
79
* ) break ;;
80
80
esac
@@ -97,18 +97,29 @@ if [ ! -d $LOGDIR ]; then
97
97
echoerr " $LOGDIR does not exist." ; help
98
98
fi
99
99
100
- if [ -z " $OUTPUT " ]; then
100
+ if [ -z " $OUTREPORT " ]; then
101
101
if [ ! -w $LOGDIR ]; then
102
102
echoerr " $LOGDIR is not writeable." ; help
103
103
fi
104
104
TIME=$( date +" %Y%m%d-%H%M%S" )
105
- OUTPUT =" $LOGDIR /FORCE_L2PS_$TIME .html"
105
+ OUTREPORT =" $LOGDIR /FORCE_L2PS_$TIME .html"
106
106
fi
107
- export OUTPUT=$( readlink -f $OUTPUT ) # absolute directory path
108
- export OUTDIR=` dirname $OUTPUT ` ;
107
+
108
+ if [[ $OUTREPORT != * .html ]]; then
109
+ echoerr " $OUTREPORT extension must be .html" ; help
110
+ fi
111
+ OUTREPORT=$( readlink -f " $OUTREPORT " ) # absolute directory path
112
+ export OUTREPORT
113
+
114
+ OUTTABLE=" ${OUTREPORT% .* } .csv"
115
+ export OUTTABLE
116
+
117
+ OUTDIR=$( dirname " $OUTREPORT " )
118
+ export
119
+
109
120
110
121
debug " binary directory: $BIN "
111
122
debug " log directory: $LOGDIR "
112
- debug " output: $OUTPUT "
123
+ debug " output: $OUTREPORT "
113
124
114
- $REPORT_EXE -e " rmarkdown::render('$REPORT_TEMPLATE ', output_file = '$OUTPUT ', intermediates_dir = '$OUTDIR ', params = list(dlog = '$LOGDIR '))"
125
+ $REPORT_EXE -e " rmarkdown::render('$REPORT_TEMPLATE ', output_file = '$OUTREPORT ', intermediates_dir = '$OUTDIR ', params = list(dlog = '$LOGDIR ', ftable = ' $OUTTABLE '))"
0 commit comments