Commit 58004ea9 authored by Hunter Loftis's avatar Hunter Loftis

Merge pull request #276 from heroku/simple-output-format

replace tee/sed/awk with a simple echo loop
parents 4058847f 9444a6f7
...@@ -2,19 +2,15 @@ info() { ...@@ -2,19 +2,15 @@ info() {
echo " $*" echo " $*"
} }
# format output on both OSX and Ubuntu, cedar-10 and cedar-14, while also splitting to a log file # format output and send a copy to the log
output() { output() {
local logfile="$1" local logfile="$1"
local c='s/^/ /'
if [ "${STACK:-cedar-14}" = "cedar" ]; then while read LINE;
tee -a "$logfile" | awk -W interactive '{ print " " $0 }' do
else echo " $LINE"
case $(uname) in echo "$LINE" >> "$logfile"
Darwin) sed -l "$c" | tee -i -a "$logfile" 2> /dev/null;; done
*) stdbuf -oL -eL sed -u "$c" | tee -i -a "$logfile" 2> /dev/null;;
esac
fi
} }
header() { header() {
......
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