4 # Full author contact details are available in file CREDITS.
8 # check for file arguments with relative path names
9 # convert them to absolute path names
10 # inkscape on Mac changes the working directory
11 # this invalidates relative path names
17 for i in ${!iparams[@]}; do
18 # echo $i "=>" "${iparams[$i]}"
19 case "${iparams[$i]}" in
20 --file=/*|--export-pdf=/*|--export-eps=/*|--export-png=/*|--export-emf=/*|--export-wmf=/*|--export-ps=/*|--export-ps-level=/*|--export-pdf-version=/*)
21 oparams+=( "${iparams[$i]}" )
23 --file=*|--export-pdf=*|--export-eps=*|--export-png=*|--export-emf=*|--export-wmf=*|--export-ps=*|--export-ps-level=*|--export-pdf-version=*)
24 oparams+=( "${iparams[$i]//=/=${pwd}/}" )
27 # ignore this argument - its provided below anyway
30 oparams+=( "${iparams[$i]}" )
34 exec "${inkscape}" --without-gui "${oparams[@]}"
37 # try to find the inkscape installation...
38 # at first try the well known location
39 RESDIR="/Applications/Inkscape.app/Contents/Resources"
40 if [ -f "${RESDIR}"/bin/inkscape -a -x "${RESDIR}"/bin/inkscape ]; then
41 startinkscape "${RESDIR}"/bin/inkscape "$@"
44 # this failed... so try PATH expansion to start the inkscape shell wrapper
45 IFS=":" read -ra DIRLIST <<< "${PATH}"
46 for BINDIR in "${DIRLIST[@]}" ; do
47 RESDIR=$(dirname "${BINDIR}")
48 if [ -f "${RESDIR}"/bin/inkscape -a -x "${RESDIR}"/bin/inkscape ]; then
49 startinkscape "${RESDIR}"/bin/inkscape "$@"
53 # report error and exit with failure status
55 echo Could not find Inkscape binary.