From 53a2f04411d8f0c95bb354ab8a5744083ec11845 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 3 Dec 2013 14:09:33 +0900 Subject: [PATCH] use SETUP_OUTPUT for setup_selfupdate --- setup.sh | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/setup.sh b/setup.sh index 97ce963..ae1f98f 100755 --- a/setup.sh +++ b/setup.sh @@ -7,6 +7,21 @@ __setups="gitconf tmux scripts darwin dirs selfupdate" __homelocal="$HOME/.local" __homevar="$HOME/.var" +########################### +# utils + +_download(){ + # download + if type wget >/dev/null 2>&1 + then + wget $__my_wget_options "$1" -O "$2" + elif type curl >/dev/null 2>&1 + then + curl --url "$1" --output "$2" + fi +} + + ############################# # gen_common @@ -57,7 +72,13 @@ __EOC__ __setup_url="https://raw.github.com/10sr/dotfiles/master/setup.sh" setup_selfupdate(){ - curl $__setup_url + if test -z "$SETUP_OUTPUT" + then + echo SETUP_OUTPUT is not set. + echo Ignore selfupdate. + return + fi + _download $__setup_url "$SETUP_OUTPUT" } ################################ @@ -154,17 +175,6 @@ __EOC__ ############################## # install_scripts -_download(){ - # download - if type wget >/dev/null 2>&1 - then - wget $__my_wget_options "$1" -O "$2" - elif type curl >/dev/null 2>&1 - then - curl --url "$1" --output "$2" - fi -} - _fetch_script(){ # _fetch_script url="$1"