The command 'pandoc' has to be execute in the document folder,
otherwise file path in tex can work.
JIRA: RELENG-16
Change-Id: Ia054f6354dceb386805b21721a6736a446980d71
Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
# TODO: failures in ODT creation should be handled error and
# cause 'exit 1' before OPNFV B release.
tex=$(find $build -name '*.tex' | head -1)
- odt=$(basename "${tex%.tex}.odt")
+ odt="${tex%.tex}.odt"
if [[ -e $tex ]] && which pandoc > /dev/null ; then
- pandoc $tex -o $output/$odt || {
+ (
+ cd $(dirname $tex)
+ pandoc $(basename $tex) -o $(basename $odt)
+ ) && {
+ mv $odt $output/
+ }|| {
msg="Error: ODT creation for $dir has failed."
echo
echo "$msg"