Commit 834c49e7 authored by Hunter Loftis's avatar Hunter Loftis

Merge pull request #271 from heroku/replace-sed-with-awk

Replace sed with awk
parents c5047820 88578e32
...@@ -2,16 +2,15 @@ info() { ...@@ -2,16 +2,15 @@ info() {
echo " $*" echo " $*"
} }
# sed -l basically makes sed replace and buffer through stdin to stdout # sed has a problem with the huge build output from npm 3
# so you get updates while the command runs and dont wait for the end # try awk? awk '{ print " " $0 }'
# e.g. npm install | indent
output() { output() {
local logfile="$1" local logfile="$1"
local c='s/^/ /' local c='s/^/ /'
case $(uname) in case $(uname) in
Darwin) tee -a "$logfile" | sed -l "$c";; # mac/bsd sed: -l buffers on line boundaries Darwin) tee -a "$logfile" | awk '{ print " " $0 }';;
*) tee -a "$logfile" | sed -u "$c";; # unix/gnu sed: -u unbuffered (arbitrary) chunks of data *) tee -a "$logfile" | awk -W interactive '{ print " " $0 }';;
esac esac
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment