diff options
-rwxr-xr-x | dmd-wrapper | 4 | ||||
-rwxr-xr-x | stdin-wrapper | 11 |
2 files changed, 6 insertions, 9 deletions
diff --git a/dmd-wrapper b/dmd-wrapper index 0a643500..2db358e7 100755 --- a/dmd-wrapper +++ b/dmd-wrapper @@ -36,6 +36,8 @@ temp_dir=$(mktemp -d 2>/dev/null || mktemp -d -t 'ale_linters') temp_file="$temp_dir/file.d" trap 'rm -r "$temp_dir"' EXIT -cp /dev/stdin "$temp_file" +while read -r; do + echo "$REPLY" >> "$temp_file" +done dmd $(import_line_options) "$@" "$temp_file" diff --git a/stdin-wrapper b/stdin-wrapper index 492035e1..f81f4617 100755 --- a/stdin-wrapper +++ b/stdin-wrapper @@ -16,13 +16,8 @@ temp_dir=$(mktemp -d 2>/dev/null || mktemp -d -t 'ale_linter') temp_file="$temp_dir/file$file_extension" trap 'rm -r "$temp_dir"' EXIT -# In perfect world it wouldn't be needed, but some tools (`go vet`, I am looking -# at you) do not fit in line and require filename ending. Otherwise it would be -# simple as -# -# "$@" /dev/stdin -# -# without all that hackery with copying `/dev/stdin` -cp /dev/stdin "$temp_file" +while read -r; do + echo "$REPLY" >> "$temp_file" +done "$@" "$temp_file" |