feat(zsh): select kas file on fu-build

This commit is contained in:
Michael Mandl 2024-12-16 08:41:05 +01:00
parent 1f4ce59419
commit 69f965cdc8
Signed by: mandlm
GPG key ID: 088ED38F036C7AF2

View file

@ -15,11 +15,35 @@
}
function fu-build {
./kas-container build kas/kas-ttc-image-horsch.yml
local fzf_preview='bat --color always --style plain {}'
kas_file=$(find kas -maxdepth 1 -type f -name "*image*.yml" \
| fzf --select-1 --exit-0 --header "Select a image file" --preview ''${fzf_preview})
if [ -z ''${kas_file} ]; then
echo "no file selected"
return 1
fi
./kas-container build ''${kas_file}
}
function fu-build-dev {
./kas-container build kas/kas-ttc-image-horsch-dev.yml
local fzf_preview='bat --color always --style plain {}'
local kas_file=kas/kas-ttc-image-horsch-dev.yml
if [ ! -f ''${kas_file} ]; then
kas_file=$(find kas -maxdepth 1 -type f -name "*image*.yml" \
| fzf --select-1 --exit-0 --header "Select a image file" --preview ''${fzf_preview})
fi
if [ -z ''${kas_file} ]; then
echo "no file selected"
return 1
fi
./kas-container build ''${kas_file}
}
function fu-reboot {