feat: add shellcheck & shfmt github actions (#33)

* refactor: separate lint shfmt and shellcheck
* feat: add simple github action task
* fix: linting bash files according to shfmt
* feat: move main method dedicated shell file
* feat: update changelog entry
This commit is contained in:
Maciej Sypien 2024-09-14 23:49:03 +02:00 committed by Maciej Sypien
parent 1b97d625e6
commit 23bbbfcaee
No known key found for this signature in database
GPG key ID: 10BC01EDA6827DC8
5 changed files with 63 additions and 31 deletions

27
src/gruvbox-main.sh Executable file
View file

@ -0,0 +1,27 @@
#!/bin/bash
SCRIPT_SRC="$(dirname "${BASH_SOURCE[${#BASH_SOURCE[@]} - 1]}")"
readonly SCRIPT_SRC
CURRENT_DIR=$(cd "${SCRIPT_SRC}" >/dev/null 2>&1 && pwd) readonly CURRENT_DIR
readonly THEME_OPTION="@tmux-gruvbox"
readonly DEFAULT_THEME="dark"
get_theme() {
local option="$1"
local default_value="$2"
local option_value
option_value=$(tmux show-option -gqv "$option")
if [ -z "$option_value" ]; then
echo "$default_value"
else
echo "$option_value"
fi
}
main() {
local theme
theme=$(get_theme "$THEME_OPTION" "$DEFAULT_THEME")
tmux source-file "$CURRENT_DIR/tmux-gruvbox-${theme}.conf"
}
main "$@"