diff --git a/copy_dotfiles b/copy_configs similarity index 58% rename from copy_dotfiles rename to copy_configs index fe5ca08..e2b6f2a 100755 --- a/copy_dotfiles +++ b/copy_configs @@ -4,23 +4,15 @@ dry="0" execute() { log "execute $@" - if [[ $dry != "1" ]]; then - "$@" - fi + [[ $dry != "1" ]] && "$@" } log() { - if [[ $dry != "1" ]]; then - echo "$@" - else - echo "[DRY RUN]: $@" - fi + [[ $dry != "1" ]] && echo "$@" || echo "[DRY RUN]: $@" } while [[ $# > 0 ]]; do - if [[ $1 == "--dry" ]]; then - dry="1" - fi + [[ $1 == "--dry" ]] && dry="1" shift done @@ -31,11 +23,8 @@ copy_dir() { to=$2 pushd $from > /dev/null dirs=(`find . -mindepth 1 -maxdepth 1 -type d`) - echo $dirs for dir in $dirs; do - if [[ -d $to/$dir ]]; then - execute rm -rf $to/$dir - fi + [[ -d $to/$dir ]] && execute rm -rf $to/$dir execute cp -rp $dir $to/$dir done popd > /dev/null @@ -45,11 +34,10 @@ copy_file() { from=$1 to=$2 filename=$(basename $from) - if [[ -e $to/$filename ]]; then - execute rm $to/$filename - fi + [[ -e $to/$filename ]] && execute rm $to/$filename execute cp -p $from $to/$filename } copy_dir .config $HOME/.config +copy_dir .local $HOME/.local # copy_file .zxcv $HOME diff --git a/pre_run_01 b/pre_run_01 index 153e6a8..7496bba 100755 --- a/pre_run_01 +++ b/pre_run_01 @@ -1,5 +1,5 @@ #!/bin/zsh -if [[ ! -d $HOME/bin ]]; then - mkdir $HOME/bin -fi +[[ ! -d $HOME/bin ]] && mkdir $HOME/bin +[[ ! -d $HOME/.config ]] && mkdir $HOME/.config +[[ ! -d $HOME/.local ]] && mkdir $HOME/.local diff --git a/run b/run index 18f2dc2..63ef645 100755 --- a/run +++ b/run @@ -5,25 +5,15 @@ dry="0" execute() { log "execute $@" - if [[ $dry != "1" ]]; then - "$@" - fi + [[ $dry != "1" ]] && "$@" } log() { - if [[ $dry != "1" ]]; then - echo "$@" - else - echo "[DRY RUN]: $@" - fi + [[ $dry != "1" ]] && echo "$@" || echo "[DRY RUN]: $@" } while [[ $# > 0 ]]; do - if [[ $1 == "--dry" ]]; then - dry="1" - else - single_script_filter="$1" - fi + [[ $1 == "--dry" ]] && dry="1" || single_script_filter="$1" shift done diff --git a/runs/dev_tools b/runs/dev_tools deleted file mode 100755 index d835e5d..0000000 --- a/runs/dev_tools +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/zsh - -brew install git tmux diff --git a/runs/git b/runs/git new file mode 100755 index 0000000..d9f9c66 --- /dev/null +++ b/runs/git @@ -0,0 +1,2 @@ +#!/bin/zsh +brew install git diff --git a/runs/tmux b/runs/tmux new file mode 100755 index 0000000..d1b2e08 --- /dev/null +++ b/runs/tmux @@ -0,0 +1,2 @@ +#!/bin/zsh +brew install tmux