Skip to content

Commit

Permalink
Revert "Fix control character sequence for compatability with Linux"
Browse files Browse the repository at this point in the history
This reverts commit cb71c2b.
  • Loading branch information
73rhodes committed Jan 26, 2012
1 parent cb71c2b commit 470d774
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions bin/n
Expand Up @@ -11,15 +11,15 @@ VERSIONS_DIR=$N_PREFIX/n/versions
#

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

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

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

# setup
Expand Down Expand Up @@ -88,7 +88,7 @@ help
#

display_n_version() {
printf $VERSION && exit 0
echo $VERSION && exit 0
}

#
Expand All @@ -114,9 +114,9 @@ display_versions() {
local version=${dir##*/}
local config=`test -f $dir/.config && cat $dir/.config`
if test "$version" = "$active"; then
printf " \033[32mο\033[0m $version \033[90m$config\033[0m\n"
printf " \e[32mο\e[0m $version \e[90m$config\e[0m\n"
else
printf " $version \033[90m$config\033[0m\n"
printf " $version \e[90m$config\e[0m\n"
fi
done
}
Expand Down Expand Up @@ -149,7 +149,7 @@ install_node() {
local url="http://nodejs.org/dist/$tarball"

# >= 0.5.x
local minor=$(printf $version | cut -d '.' -f 2)
local minor=$(echo $version | cut -d '.' -f 2)
test $minor -ge "5" && url="http://nodejs.org/dist/v$version/$tarball"

install_tarball $version $url $config
Expand Down Expand Up @@ -182,12 +182,12 @@ install_tarball() {
# see if things are alright
if test $? -gt 0; then
rm $tarball
printf "\033[31mError: installation failed\033[0m"
printf " node version $version does not exist,"
printf " n failed to fetch the tarball,"
printf " or tar failed. Try a different"
printf " version or view $logpath to view"
printf " error details."
echo "\033[31mError: installation failed\033[0m"
echo " node version $version does not exist,"
echo " n failed to fetch the tarball,"
echo " or tar failed. Try a different"
echo " version or view $logpath to view"
echo " error details."
exit 1
fi

Expand All @@ -197,7 +197,7 @@ install_tarball() {
&& cd .. \
&& cleanup $version \
&& mkdir -p $dir \
&& printf $config > "$dir/.config" \
&& echo $config > "$dir/.config" \
&& n $version \
&& ln -s "$N_PREFIX/n/versions/$version" "$N_PREFIX/n/current"
}
Expand Down Expand Up @@ -312,10 +312,10 @@ list_versions() {

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

0 comments on commit 470d774

Please sign in to comment.