Update sync with files

This commit is contained in:
Mylloon 2023-03-19 19:45:57 +01:00
parent 634ad14a18
commit b9d8a7064e
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -1,6 +1,10 @@
# Version control # Version control
VC = git VC = git
# Downloaders
WGET = wget -q --show-progress
CURL = curl -s
# Hide some verbose messages from Make # Hide some verbose messages from Make
MAKEFLAGS += --no-print-directory MAKEFLAGS += --no-print-directory
@ -8,7 +12,9 @@ all: full-sync
# Pull latest changes # Pull latest changes
refresh: refresh:
@echo Pull latest changes from repository...
@$(VC) pull @$(VC) pull
@echo
# Pull and sync # Pull and sync
full-sync: full-sync:
@ -19,39 +25,71 @@ full-sync:
# .config # .config
sync-dotconfig: sync-dotconfig:
# Fish
@mkdir -p $(HOME)/.config/fish/conf.d @mkdir -p $(HOME)/.config/fish/conf.d
@mkdir -p $(HOME)/.config/fish/functions @mkdir -p $(HOME)/.config/fish/functions
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/functions/fish_prompt.fish -O $(HOME)/.config/fish/functions/fish_prompt.fish
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/conf.d/promp_color.fish -O $(HOME)/.config/fish/conf.d/promp_color.fish
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/conf.d/abbr.fish -O $(HOME)/.config/fish/conf.d/abbr.fish
# Micro
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/micro/settings.json -O $(HOME)/.config/micro/settings.json
# END
@echo .config directory synced! @echo .config directory synced!
@echo
# .emacs.d # .emacs.d
sync-emacs: sync-emacs:
@mkdir -p $(HOME)/.emacs.d
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.emacs.d/init.el -O $(HOME)/.emacs.d/init.el
# END
@echo Emacs config synced! @echo Emacs config synced!
@echo
# .mozilla # .mozilla
sync-mozilla: sync-mozilla:
# END
@echo Firefox config synced! @echo Firefox config synced!
@echo
# .unison # .dotfiles
sync-unison: sync-dotfiles:
@echo Unison preferences synced! # .gitconfig
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/dotfiles/.gitconfig -O $(HOME)/.gitconfig
# .ocamlformat
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/dotfiles/.ocamlformat -O $(HOME)/.ocamlformat
# .clang-format
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/dotfiles/.clang-format -O $(HOME)/.clang-format
# End
@echo dotfiles synced!
@echo
# === Specific platforms == # === Specific platforms ==
sync: sync:
@$(MAKE) sync-dotconfig
@$(MAKE) sync-dotfiles
@$(MAKE) sync-emacs
ifeq ($(shell grep -c "archlinux" /proc/version), 1) ifeq ($(shell grep -c "archlinux" /proc/version), 1)
# Arch # Arch
@$(MAKE) sync-dotconfig
@$(MAKE) sync-emacs
@$(MAKE) sync-mozilla @$(MAKE) sync-mozilla
else ifeq ($(shell grep -c "WSL" /proc/version), 1) else ifeq ($(shell grep -c "WSL" /proc/version), 1)
# WSL # WSL
@$(MAKE) sync-dotconfig @mkdir -p $(HOME)/.unison
@$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.unison/default.prf -O $(HOME)/.unison/default.prf
# Specific
@$(MAKE) sync-emacs @$(WGET) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/config_wsl.fish -O $(HOME)/.config/fish/config.fish_prompt
@$(MAKE) sync-unison @$(CURL) https://git.mylloon.fr/Anri/confOS/raw/branch/main/.config/fish/conf.d/abbr_wsl.fish >> $(HOME)/.config/fish/conf.d/abbr.fish
endif endif
# END
@echo 🎉 Sync complete!