From 9467b1ea5a208bdd3b800495ee66e71b27e51631 Mon Sep 17 00:00:00 2001 From: Shmueli Englard Date: Wed, 29 Mar 2017 12:52:08 -0400 Subject: [PATCH 1/2] defining functions with the keyword is not supported in all shells --- install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 6cd3497..73a9e5f 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,6 @@ #!/bin/sh -function _fetch_sources() { +_fetch_sources(){ wget -O /tmp/nanorc.zip https://github.com/scopatz/nanorc/archive/master.zip if [ ! -d ~/.nano/ ] then @@ -15,7 +15,7 @@ function _fetch_sources() { rm /tmp/nanorc.zip } -function _update_nanorc() { +_update_nanorc(){ if [ ! -f ~/.nanorc ] then touch ~/.nanorc @@ -29,7 +29,7 @@ function _update_nanorc() { done < ~/.nano/nanorc } -function _update_nanorc_lite() { +_update_nanorc_lite(){ sed -i '/include "\/usr\/share\/nano\/\*\.nanorc"/i include "~\/.nano\/*.nanorc"' "${NANORC_FILE}" } From 0149f4be82f7a56cb33ef3fb47078f220d8b98db Mon Sep 17 00:00:00 2001 From: Shmueli Englard Date: Wed, 29 Mar 2017 12:52:59 -0400 Subject: [PATCH 2/2] the extra ; and [] caused parsing issues --- install.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 73a9e5f..04e0cf7 100755 --- a/install.sh +++ b/install.sh @@ -45,8 +45,9 @@ case "$1" in esac _fetch_sources; -if [[ $UPDATE_LITE ]]; then - _update_nanorc_lite; +if [ $UPDATE_LITE ]; +then + _update_nanorc_lite else - _update_nanorc; + _update_nanorc fi