Add support for checking Haskell code via a wrapper script which can be used for other tools, and fix a readline problem with the DMD wrapper script.

This commit is contained in:
w0rp
2016-09-18 23:58:04 +01:00
parent e0fc0c7bb6
commit 57ef2c9833
5 changed files with 107 additions and 4 deletions

23
stdin-wrapper Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/bash -eu
# This script implements a wrapper for any program which does not accept
# stdin input on most Unix machines. The input to the script is read to a
# temporary file, and the first argument sets a particular file extension
# for the temporary file.
#
# All of the following arguments are read as command to run.
file_extension="$1"
shift
temp_file=`mktemp`
mv "$temp_file" "$temp_file$file_extension"
temp_file="$temp_file$file_extension"
trap "rm $temp_file" EXIT
while read; do
echo "$REPLY" >> "$temp_file"
done
"$@" "$temp_file"