#!/bin/sh
EXE=skroogeconvert

#initialisation
. "`dirname \"$0\"`/init.sh"

cd "${OUT}skroogeconvert/"
"${EXE}" --in "${IN}/skgtestimportgnucash/228904.gnucash" --out 228904.skg
rc=$?
if [ $rc != 0 ] ; then
	exit $rc
fi

"${EXE}" --in 228904.skg --out 228904.csv
rc=$?
if [ $rc != 0 ] ; then
	exit $rc
fi

export LANG="fr_FR.ISO8859-15"
export MM_CHARSET="ISO-8859-15"
export LC_ALL="fr_FR.ISO8859-1"

SPECIALDIR="${OUT}skroogeconvert/téléchargement"
mkdir "${SPECIALDIR}"
"${EXE}" --in 228904.csv --out "${SPECIALDIR}/228904.csv" --param header_position --value 1
rc=$?
if [ $rc != 0 ] ; then
	exit $rc
fi

#For coverage
"${EXE}" --in 228904.csv

#"${EXE}" --in ftp://skrooge.org/files/skgtestimporturl/test.skg --out t.csv
#rc=$?
#if [ $rc != 0 ] ; then
#	exit $rc
#fi

exit 0
