#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
basedir_win="$basedir"
exe=""
msys=""

case `uname -a` in
  *CYGWIN*|*MINGW*|*MSYS*)
    if command -v cygpath > /dev/null 2>&1; then
      basedir_win=`cygpath -w "$basedir"`
    fi
    exe=".exe"
    msys="true"
  ;;
  *WSL2*)
    if command -v wslpath > /dev/null 2>&1; then
      basedir_win="$(wslpath -w "$basedir" 2> /dev/null)"
      if [ $? -ne 0 ] || [ -z "$basedir_win" ]; then
        basedir_win="$basedir"
      else
        exe=".exe"
      fi
    fi
  ;;
esac

if [ -z "$NODE_PATH" ]; then
  export NODE_PATH="/build/immich/src/immich-3.1.0/output/server-pruned/node_modules/.pnpm/exiftool-vendored.pl@13.59.0/node_modules/exiftool-vendored.pl/node_modules:/build/immich/src/immich-3.1.0/output/server-pruned/node_modules/.pnpm/exiftool-vendored.pl@13.59.0/node_modules:/build/immich/src/immich-3.1.0/output/server-pruned/node_modules/.pnpm/node_modules"
else
  export NODE_PATH="/build/immich/src/immich-3.1.0/output/server-pruned/node_modules/.pnpm/exiftool-vendored.pl@13.59.0/node_modules/exiftool-vendored.pl/node_modules:/build/immich/src/immich-3.1.0/output/server-pruned/node_modules/.pnpm/exiftool-vendored.pl@13.59.0/node_modules:/build/immich/src/immich-3.1.0/output/server-pruned/node_modules/.pnpm/node_modules:$NODE_PATH"
fi
if [ -n "$exe" ] && [ -x "$basedir/perl.exe" ]; then
  exec "$basedir/perl.exe"  "$basedir_win/../../../../../exiftool-vendored.pl@13.59.0/node_modules/exiftool-vendored.pl/bin/exiftool" "$@"
elif [ -x "$basedir/perl" ]; then
  exec "$basedir/perl"  "$basedir/../../../../../exiftool-vendored.pl@13.59.0/node_modules/exiftool-vendored.pl/bin/exiftool" "$@"
elif command -v perl >/dev/null 2>&1; then
  exec perl  "$basedir/../../../../../exiftool-vendored.pl@13.59.0/node_modules/exiftool-vendored.pl/bin/exiftool" "$@"
elif [ -n "$exe" ] && command -v perl.exe >/dev/null 2>&1; then
  exec perl.exe  "$basedir_win/../../../../../exiftool-vendored.pl@13.59.0/node_modules/exiftool-vendored.pl/bin/exiftool" "$@"
else
  exec perl  "$basedir/../../../../../exiftool-vendored.pl@13.59.0/node_modules/exiftool-vendored.pl/bin/exiftool" "$@"
fi
# cmd-shim-target=/build/immich/src/immich-3.1.0/output/server-pruned/node_modules/.pnpm/exiftool-vendored.pl@13.59.0/node_modules/exiftool-vendored.pl/bin/exiftool
