Skip to content

Commit

Permalink
Fixes linux nc integration, fix #1
Browse files Browse the repository at this point in the history
  • Loading branch information
ruyadorno committed Oct 19, 2017
1 parent 3a30b5d commit 2664a87
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion prettierme
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ if [ -z "$prettierddata" ]; then
prettierdtoken=$(echo $prettierddata | cut -d ' ' -f 2)
fi

if nc 2>&1 | grep -- -q >/dev/null; then
NC_OPTIONS="-q 0"
else
NC_OPTIONS=""
fi

# uses netcat to lint the file
echo "$prettierdtoken {\"cwd\":\"$PWD\",\"args\":[\"--write\", \"--local-only\", \"--pkg-conf\", \"$1\"]}" | nc 127.0.0.1 "$prettierdport"
echo "$prettierdtoken {\"cwd\":\"$PWD\",\"args\":[\"--write\", \"--local-only\", \"--pkg-conf\", \"$1\"]}" | nc $NC_OPTIONS 127.0.0.1 "$prettierdport"

0 comments on commit 2664a87

Please # to comment.