annotate tools/gen-bat-wrapper @ 4253:32a7bea19bb1

msys-gzip: add .bat wrappers to shellscripts * tools/gen-bat-wrapper: new file * dist-files.mk: add gen-bat-wrapper * src/msys-gzip.mk: add find of shell script and create .bat file
author John D
date Mon, 21 Nov 2016 17:11:21 -0500
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4253
32a7bea19bb1 msys-gzip: add .bat wrappers to shellscripts
John D
parents:
diff changeset
1 #!/usr/bin/env bash
32a7bea19bb1 msys-gzip: add .bat wrappers to shellscripts
John D
parents:
diff changeset
2
32a7bea19bb1 msys-gzip: add .bat wrappers to shellscripts
John D
parents:
diff changeset
3 prog=$1
32a7bea19bb1 msys-gzip: add .bat wrappers to shellscripts
John D
parents:
diff changeset
4
32a7bea19bb1 msys-gzip: add .bat wrappers to shellscripts
John D
parents:
diff changeset
5 if [ -z $prog ]; then
32a7bea19bb1 msys-gzip: add .bat wrappers to shellscripts
John D
parents:
diff changeset
6 echo "Missing program name" >&2
32a7bea19bb1 msys-gzip: add .bat wrappers to shellscripts
John D
parents:
diff changeset
7 exit 1
32a7bea19bb1 msys-gzip: add .bat wrappers to shellscripts
John D
parents:
diff changeset
8 fi
32a7bea19bb1 msys-gzip: add .bat wrappers to shellscripts
John D
parents:
diff changeset
9
32a7bea19bb1 msys-gzip: add .bat wrappers to shellscripts
John D
parents:
diff changeset
10 cat << EOF
32a7bea19bb1 msys-gzip: add .bat wrappers to shellscripts
John D
parents:
diff changeset
11 @echo off
32a7bea19bb1 msys-gzip: add .bat wrappers to shellscripts
John D
parents:
diff changeset
12 set BINPATH=%~dp0
32a7bea19bb1 msys-gzip: add .bat wrappers to shellscripts
John D
parents:
diff changeset
13 %BINPATH%bash -c '$prog %*'
32a7bea19bb1 msys-gzip: add .bat wrappers to shellscripts
John D
parents:
diff changeset
14 EOF