summaryrefslogtreecommitdiff
path: root/stdin-wrapper
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2016-11-01 20:17:13 +0000
committerw0rp <devw0rp@gmail.com>2016-11-01 20:30:15 +0000
commitf03fb64e5187aad15cf4abcb9bc8f9a5330225cd (patch)
tree3006cf9da3cca7063eacd40ced077b423d7b9742 /stdin-wrapper
parent4088347901ad5f0388d65b347501223abb2aa475 (diff)
downloadale-f03fb64e5187aad15cf4abcb9bc8f9a5330225cd.zip
#160 Switch back to using readline for writing stdin to the temporary file, because it actually works on all machines.
Diffstat (limited to 'stdin-wrapper')
-rwxr-xr-xstdin-wrapper11
1 files changed, 3 insertions, 8 deletions
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"