From c752b6876f5a9eb80b833696841ca66eb4e50ca0 Mon Sep 17 00:00:00 2001 From: Kjetil Orbekk Date: Wed, 10 Jun 2015 01:57:35 -0400 Subject: Change echo=>printf in setup script, which also works on OS X. --- bin/setup.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'bin/setup.sh') diff --git a/bin/setup.sh b/bin/setup.sh index afc42e2..6b9015e 100755 --- a/bin/setup.sh +++ b/bin/setup.sh @@ -8,12 +8,12 @@ none='\e[0m' cd # Check that things are in their right places. if [[ ! -f dotfiles/bin/setup.sh ]]; then - echo -e "${red}[FAIL]${none} expected to find myself" + printf "${red}[FAIL]${none} expected to find myself\n" exit 1 fi if ! which git >/dev/null; then - echo -e "${red}[FAIL]${none} git not installed" + printf "${red}[FAIL]${none} git not installed\n" exit 1 fi @@ -26,17 +26,17 @@ cd # Does nothing and prints an error message if $2 exists and is not a symlink. create_symlink() { if [[ -e "$2" && ! -h "$2" ]]; then - echo -e "${orange}[SKIPPED]${none} '$2' exists and is not a symlink." + printf "${orange}[SKIPPED]${none} '$2' exists and is not a symlink.\n" return else if ln -sf "$1" "$2"; then - echo -e "${green}[OK]${none} '$2' → '$1'" + printf "${green}[OK]${none} '$2' → '$1'\n" else - echo -e "${red}[WARNING]${none} could not create '$2'" + printf "${red}[WARNING]${none} could not create '$2'\n" fi fi if ! diff "$2" "$(dirname $2)/$1"; then - echo -e "${red}[WARNING]${none} diffs in $2" + printf "${red}[WARNING]${none} diffs in $2\n" fi } @@ -46,19 +46,19 @@ create_symlink /dev/null .vimrc.local if [[ "${SHELL}" = *zsh* ]]; then create_symlink dotfiles/zshrc .zshrc else - echo -e "${orange}[SKIPPED]${none} shell is not zsh :-(." + printf "${orange}[SKIPPED]${none} shell is not zsh :-(.\n" fi if which i3 >/dev/null; then mkdir -p .i3 create_symlink ../dotfiles/i3/config .i3/config else - echo -e "${orange}[SKIPPED]${none} i3 not installed." + printf "${orange}[SKIPPED]${none} i3 not installed.\n" fi create_symlink dotfiles/vimrc .vimrc if [[ -e .vim/bundle/Vundle.vim ]]; then - echo -e "${orange}[SKIPPED]${none} Vundle.vim already installed" + printf "${orange}[SKIPPED]${none} Vundle.vim already installed\n" else success=1 mkdir -p .vim/bundle @@ -66,8 +66,8 @@ else || success=0 vim +PluginInstall +qall || success=0 if [[ "$success" == "1" ]]; then - echo -e "${green}[OK]${none} installed vim plugins" + printf "${green}[OK]${none} installed vim plugins\n" else - echo -e "${red}[WARNING]${none} failed to install vim plugins" + printf "${red}[WARNING]${none} failed to install vim plugins\n" fi fi -- cgit v1.2.3