5 # Text file conversion script for packaging on Windows
7 # This script copies a text file from a source to a destination,
8 # converting line endings and adding a ".txt" filename extension
9 # if needed. If the destination is a directory the source file
10 # name is used. Newer files will not be overwritten.
12 # The destination file should be double-clickable and usable
13 # when Notepad is the default editor.
23 echo " $0 <source file> <destination file>"
28 if [ -z "$SRC" -o -z "$DST" ] ; then
32 if [ ! -r "$SRC" ] ; then
33 err_exit "Can't read $SRC"
36 if [ -f "$DST" -a "$DST" -nt "SRC" ]; then
40 if [ -d "$DST" ] ; then
41 DSTBASE=`basename "$SRC" txt`
42 DST="$DST/$DSTBASE.txt"
44 DSTDIR=`dirname "$DST"`
45 DSTBASE=`basename "$DST" txt`
46 DST="$DSTDIR/$DSTBASE.txt"