prevent unecesary pre_deploy script executions

This commit is contained in:
Alexander Navarro 2024-11-20 11:29:46 -03:00
parent f33c57f1a4
commit 8ccda61811
5 changed files with 42 additions and 3 deletions

View file

@ -7,7 +7,7 @@ header = ".dotter/handlebars_helpers/header.rhai"
# CLI package # CLI package
[cli] [cli]
depends = ["nvim", "zsh"] depends = ["nvim", "zsh", "fzf", "starship"]
[cli.variables] [cli.variables]
nerd_font = "JetBrainsMono" nerd_font = "JetBrainsMono"
@ -15,7 +15,6 @@ nerd_font = "JetBrainsMono"
[cli.files] [cli.files]
"config/bat" = "~/.config/bat" "config/bat" = "~/.config/bat"
"config/sesh" = "~/.config/sesh" "config/sesh" = "~/.config/sesh"
"config/starship.toml" = "~/.config/starship.toml"
"config/tmux" = "~/.config/tmux" "config/tmux" = "~/.config/tmux"
"config/yazi" = "~/.config/yazi" "config/yazi" = "~/.config/yazi"
"config/zellij" = "~/.config/zellij" "config/zellij" = "~/.config/zellij"
@ -34,8 +33,13 @@ depends = ["rust"]
"config/zsh/aliases" = {target = "~/.config/zsh/aliases", type="symbolic"} "config/zsh/aliases" = {target = "~/.config/zsh/aliases", type="symbolic"}
"config/zsh/completions" = {target = "~/.config/zsh/completions", type = "symbolic"} "config/zsh/completions" = {target = "~/.config/zsh/completions", type = "symbolic"}
"config/zsh/functions" = "~/.config/zsh/functions" "config/zsh/functions" = "~/.config/zsh/functions"
[fzf.files]
"config/fzf" = "~/.config/fzf" "config/fzf" = "~/.config/fzf"
[starship.files]
"config/starship.toml" = "~/.config/starship.toml"
[nushell.files] [nushell.files]
"config/nushell" = "~/.config/nushell" "config/nushell" = "~/.config/nushell"
@ -44,3 +48,6 @@ depends = ["rust"]
[rust.variables] [rust.variables]
cargo.packages = [] cargo.packages = []
[mise.files]
"config/mise" = "~/.config/mise"

3
.dotter/post_deploy.sh Normal file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env bash
sha256sum .dotter/cache/.dotter/pre_deploy.sh >.dotter/cache/pre_deploy.checksum

View file

@ -2,6 +2,15 @@
# shellcheck disable=all # shellcheck disable=all
# This is a handlerbars template, so ignore issues # This is a handlerbars template, so ignore issues
checksum_file=".dotter/cache/pre_deploy.checksum"
if [[ -e "$checksum_file" ]] && sha256sum --check "$checksum_file" >/dev/null 2>&1; then
echo "Pre deploy script has not changed, skiping script execution"
echo "To override this, remove the checksum file: $checksum_file"
exit 0
fi
{{!~ Detect the distribution ~}} {{!~ Detect the distribution ~}}
{{~ assign "distro" (trim (command_output "awk -F= '/^ID=/ {print $2}' /etc/os-release | tr -d '\"'")) ~}} {{~ assign "distro" (trim (command_output "awk -F= '/^ID=/ {print $2}' /etc/os-release | tr -d '\"'")) ~}}

View file

@ -1,5 +1,5 @@
includes = [".dotter/machines/fedora.toml"] includes = [".dotter/machines/fedora.toml"]
packages = ["cli", "dev"] packages = ["cli", "dev", "mise"]
[files] [files]

View file

@ -115,6 +115,9 @@ setopt hist_find_no_dups
# case insensitive completion # case insensitive completion
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}' zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}"
{{ #if dotter.packages.fzf }}
zstyle ':completion:*' menu no zstyle ':completion:*' menu no
zstyle ':fzf-tab:*' show-group full zstyle ':fzf-tab:*' show-group full
zstyle ':fzf-tab:*' continuous-trigger '/' zstyle ':fzf-tab:*' continuous-trigger '/'
@ -153,6 +156,8 @@ zstyle ':fzf-tab:complete:git-checkout:*' fzf-preview \
# TLDR # TLDR
zstyle ':fzf-tab:complete:tldr:argument-1' fzf-preview 'tldr --color always $word' zstyle ':fzf-tab:complete:tldr:argument-1' fzf-preview 'tldr --color always $word'
{{ /if }}
# ╭──────────────────────────────────────────────────────────╮ # ╭──────────────────────────────────────────────────────────╮
# │ ZSH Options │ # │ ZSH Options │
# ╰──────────────────────────────────────────────────────────╯ # ╰──────────────────────────────────────────────────────────╯
@ -163,7 +168,10 @@ setopt GLOB_DOTS
# ╭──────────────────────────────────────────────────────────╮ # ╭──────────────────────────────────────────────────────────╮
# │ Source other files │ # │ Source other files │
# ╰──────────────────────────────────────────────────────────╯ # ╰──────────────────────────────────────────────────────────╯
{{ #if dotter.packages.fzf }}
source $HOME/.config/fzf/fzfrc source $HOME/.config/fzf/fzfrc
{{ /if }}
# this prevents errors and not loading some files # this prevents errors and not loading some files
for file in $HOME/.config/zsh/**/*.zsh; do for file in $HOME/.config/zsh/**/*.zsh; do
@ -173,7 +181,19 @@ done
# ╭──────────────────────────────────────────────────────────╮ # ╭──────────────────────────────────────────────────────────╮
# │ Init external programs │ # │ Init external programs │
# ╰──────────────────────────────────────────────────────────╯ # ╰──────────────────────────────────────────────────────────╯
{{ #if dotter.packages.fzf }}
eval "$(fzf --zsh)" eval "$(fzf --zsh)"
{{ /if ~}}
{{ #if (is_executable "zoxide") }}
eval "$(zoxide init --cmd cd zsh)" eval "$(zoxide init --cmd cd zsh)"
{{ /if ~}}
{{ #if dotter.packages.starship }}
eval "$(starship init zsh)" eval "$(starship init zsh)"
{{ /if ~}}
{{ #if dotter.packages.mise }}
eval "$(mise activate zsh)" eval "$(mise activate zsh)"
{{ /if ~}}