This commit is contained in:
Thomas Forgione 2020-01-31 14:44:36 +01:00
parent ede0164958
commit de7b19e9b9
1 changed files with 10 additions and 10 deletions

View File

@ -146,7 +146,7 @@ clone_dotfiles() {
error "git is needed, but you don't have git or sudo" error "git is needed, but you don't have git or sudo"
return 1 return 1
else else
yes_no_ask_required "you'll need git for this, do you wish to install git ?" yes_no_ask_required "you'll need git for this, do you wish to install git?"
install git install git
fi fi
fi fi
@ -167,7 +167,7 @@ clone_dotfiles() {
configure_dotfiles() { configure_dotfiles() {
if [ ! -d $HOME/.config/dotfiles ]; then if [ ! -d $HOME/.config/dotfiles ]; then
yes_no_ask "do you wish to configure the dotfiles ?" yes_no_ask "do you wish to configure the dotfiles?"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
return return
fi fi
@ -178,9 +178,9 @@ configure_dotfiles() {
configure_shell() { configure_shell() {
yes_no_ask "do you wish to install and configure zsh ?" yes_no_ask "do you wish to install and configure zsh?"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
yes_no_ask "you don't want zsh ? Ok... but can I at least give you a nice bashrc ?" yes_no_ask "you don't want zsh? Ok... but can I at least give you a nice bashrc?"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
info "ok :'( I guess I'm not doing anything then" info "ok :'( I guess I'm not doing anything then"
@ -208,7 +208,7 @@ configure_shell() {
error "zsh is needed, but you don't have zsh or sudo" error "zsh is needed, but you don't have zsh or sudo"
return 1 return 1
else else
yes_no_ask_required "this magnificent prompt is based on zsh, do you wish to install zsh ?" yes_no_ask_required "this magnificent prompt is based on zsh, do you wish to install zsh?"
install zsh install zsh
fi fi
fi fi
@ -243,7 +243,7 @@ configure_shell() {
if [ $sudo_available -eq 0 ]; then if [ $sudo_available -eq 0 ]; then
# Sudo is available, run chsh # Sudo is available, run chsh
yes_no_ask "do you want to change your shell ?" yes_no_ask "do you want to change your shell?"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
info "changing your shell" info "changing your shell"
sudo chsh $user -s /bin/zsh sudo chsh $user -s /bin/zsh
@ -252,7 +252,7 @@ configure_shell() {
fi fi
else else
info "you don't have root, but you can run 'exec zsh' at the end of your bashrc" info "you don't have root, but you can run 'exec zsh' at the end of your bashrc"
yes_no_ask "do you wish to do that ?" yes_no_ask "do you wish to do that?"
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo >> $HOME/.bashrc echo >> $HOME/.bashrc
echo "exec zsh" >> $HOME/.bashrc echo "exec zsh" >> $HOME/.bashrc
@ -271,7 +271,7 @@ configure_neovim() {
return return
fi fi
yes_no_ask "do you wish to install and configure neovim ?" yes_no_ask "do you wish to install and configure neovim?"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
info "not installing neovim" info "not installing neovim"
@ -308,7 +308,7 @@ configure_neovim() {
} }
configure_rust() { configure_rust() {
yes_no_ask "do you wish to install and configure rust ?" yes_no_ask "do you wish to install and configure rust?"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
return return
fi fi
@ -320,7 +320,7 @@ main() {
echo_green "=== WELCOME TO TFORGIONE'S CONFIG INSTALLER ===" echo_green "=== WELCOME TO TFORGIONE'S CONFIG INSTALLER ==="
info "before anything, i need to know if your user can use sudo" info "before anything, i need to know if your user can use sudo"
yes_no_ask "can your user use sudo ?" yes_no_ask "can your user use sudo?"
sudo_available=$? sudo_available=$?
configure_dotfiles configure_dotfiles