Skip to content

Commit

Permalink
swap echo for printf. closes #44
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Dec 8, 2011
1 parent 36918eb commit 8d1ec71
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions bin/n
Expand Up @@ -11,15 +11,15 @@ VERSIONS_DIR=$N_PREFIX/n/versions
#

log() {
echo "\033[90m...\033[0m $@"
echo "\e[90m...\e[0m $@\n"
}

#
# Exit with the given <msg ...>
#

abort() {
echo "\033[31mError: $@\033[0m" && exit 1
printf "\e[31mError: $@\e[0m\n" && exit 1
}

# setup
Expand Down Expand Up @@ -112,9 +112,9 @@ display_versions() {
local version=${dir##*/}
local config=`test -f $dir/.config && cat $dir/.config`
if test "$version" = "$active"; then
echo " \033[32mο\033[0m $version \033[90m$config\033[0m"
printf " \e[32mο\e[0m $version \e[90m$config\e[0m\n"
else
echo " $version \033[90m$config\033[0m"
printf " $version \e[90m$config\e[0m\n"
fi
done
}
Expand Down Expand Up @@ -290,12 +290,12 @@ list_versions() {

for v in $versions; do
if test "$active" = "$v"; then
echo " \033[32mο\033[0m $v \033[0m"
printf " \e[32mο\e[0m $v \e[0m\n"
else
if test -d $VERSIONS_DIR/$v; then
echo " * $v \033[0m"
printf " * $v \e[0m\n"
else
echo " $v"
printf " $v\n"
fi
fi
done
Expand Down

0 comments on commit 8d1ec71

Please sign in to comment.