X-Git-Url: https://nuage.metani.fr/gitweb/3GPP.git/blobdiff_plain/5a64e60ec186f693ccb704467424a8a485e45c94..c2c7b9501c6e559e48099cfb9c1736e1875abacc:/bin/docx2asn diff --git a/bin/docx2asn b/bin/docx2asn index 7618cb8..832f134 100755 --- a/bin/docx2asn +++ b/bin/docx2asn @@ -11,14 +11,24 @@ if [[ ! -w . ]] ; then exit 1 fi -if [[ ! -x $(which libreoffice) ]] ; then - echo "Cannot find executable libreoffice" +echo "platform est $platform" + +case $platform in + Linux) libreoffice="libreoffice" ;; + CYGWIN*) libreoffice="soffice" ;; + *) print "Unkown platform $platform" + exit 1;; +esac + +if [[ ! -x $(which "$libreoffice") ]] ; then + echo "Cannot find libreoffice executable" + echo "Make sure it is installed and the PATH variable includes its path" exit 1 fi while [ "$#" -gt 0 ]; do - echo "Processing parameter: $1" + echo "Processing $1" if [[ ! -f "$1" ]] || [[ ! -r "$1" ]] ; then echo "$1 is not a readable file" @@ -30,7 +40,7 @@ while [ "$#" -gt 0 ]; do echo "${1%.docx}.txt already exists: skipping conversion" else - libreoffice --convert-to txt "$1" + $libreoffice --convert-to txt "$1" if [[ ! -f "${1%.docx}.txt" ]] || [[ ! -r "${1%.docx}.txt" ]] ; then echo "libreoffice did not create ${1%.docx}.txt"