From 4b19d4acec907e48116a98ec5a5c946ef8616d46 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Tue, 12 Dec 2023 18:13:09 +0100 Subject: [PATCH] Add basic install.sh script --- install.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..b061b4f --- /dev/null +++ b/install.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +################# +### FONCTIONS ### +################# + +# FROM https://github.com/aaaaadrien/fedora-config/blob/main/config-fedora.sh +check_cmd() +{ + if [[ $? -eq 0 ]] + then + echo -e "$1 : \033[32mOK\033[0m" + else + echo -e "$1 : \033[31mERREUR\033[0m" + fi +} + +prepare_doom() { + if [ ! -d ~/.config/emacs ] + then + git clone --depth 1 https://github.com/doomemacs/doomemacs ~/.config/emacs + check_cmd "INSTALL DOOM" + else + ~/.config/emacs/bin/doom upgrade + check_cmd "UPDATE DOOM" + fi +} + +prepare_custom_conf() { + if [ ! -d ~/.config/doom ] + then + git clone https://gitea.mrdev023.fr/florian.richer/emacs_conf ~/.config/doom + check_cmd "INSTALL CUSTOM CONF" + else + git -C ~/.config/doom pull origin main + check_cmd "UPDATE CUSTOM CONF" + fi +} + +sync_doom() { + ~/.config/emacs/bin/doom sync + check_cmd "FINISH DOOM INSTALL" +} +##################### +### FIN FONCTIONS ### +##################### + +################# +### PROGRAMME ### +################# + +prepare_doom +prepare_custom_conf +sync_doom