Skip to content

Commit

Permalink
Non-zsh install script
Browse files Browse the repository at this point in the history
  • Loading branch information
szajbus committed Aug 23, 2021
1 parent 7487ce1 commit f5e60d6
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions install.zsh → install.sh
@@ -1,14 +1,11 @@
#!/usr/bin/env zsh
#!/bin/sh
# Usage:
# install.zsh

autoload -Uz colors
colors
# install.sh

function ask {
local answer=false

echo -n " ${fg[yellow]}${argv[1]} (y/N): ${reset_color}"
echo -n " ${argv[1]} (y/N): "
read -sq && local answer=true
$answer && echo yes || echo no
$answer && return 0
Expand All @@ -29,26 +26,26 @@ function install-dotfiles {
fi

[[ -d $src ]] && local slash='/'
echo "+ ${fg[green]}${argv[1]}${slash}${reset_color}"
echo "+ ${argv[1]}${slash}"
}

function execute-script {
local script="${HOME}/dotfiles/install/${argv[1]}"
`${script} > /dev/null 2>&1`
echo "+ ${fg[green]}${argv[1]}${reset_color}"
echo "+ ${argv[1]}"
}

function ask-execute-script {
ask "install ${argv[1]}?" && execute-script $argv[1]
}

function group {
echo "[${fg[magenta]}${argv[1]}${reset_color}]"
echo "[${argv[1]}]"
}

function copy-files {
cp -f ${HOME}/dotfiles/${argv[1]}/* ${argv[2]}
echo "+ ${fg[green]}${argv[1]}${reset_color}"
echo "+ ${argv[1]}"
}

local backup=false
Expand Down

0 comments on commit f5e60d6

Please sign in to comment.