#! /bin/sh

# gen-file-list dir-with-stuff

source="$1"

add_pyc() {
  while read path; do
    echo $path
    case $path in
      *.py)
        echo ${path}c
        ;;
    esac
  done
}

# Delete "$INSTDIR\ggap.exe"
(cd "$source" && find -L * -type f) | add_pyc | sed -e 's@/@\\@g' -e 's@^@Delete "\$INSTDIR\\'"$dest\\\\"'@' -e 's@$@"@' -e 's@\\\\@\\@' || exit 1

# RMDir "$INSTDIR\plugins\imageformats"
(cd "$source" && find -L * -depth -type d) | sed -e 's@/@\\@g' -e 's@^@RMDir "\$INSTDIR\\'"$dest\\\\"'@' -e 's@$@"@' -e 's@\\\\@\\@' || exit 1
