diff --git a/config/config.sh b/config/config.sh index d044662..40e501a 100644 --- a/config/config.sh +++ b/config/config.sh @@ -1,6 +1,11 @@ #!/bin/bash -export GOELAND_apt_packages=( +export GLD_dotfiles=( + "aliases" + "functions" +) + +export GLD_apt_packages=( "apt-transport-https" "build-essential" "ca-certificates" @@ -11,6 +16,7 @@ export GOELAND_apt_packages=( "htop" "make" "procps" + "shellcheck" "software-properties-common" "tree" "virtualbox" @@ -18,7 +24,7 @@ export GOELAND_apt_packages=( "zsh" ) -export GOELAND_snap_packages=( +export GLD_snap_packages=( "code --classic" "discord" "gimp" @@ -29,30 +35,25 @@ export GOELAND_snap_packages=( "vlc" ) -export GOELAND_brew_formulaes=( +export GLD_brew_formulaes=( "thefuck" ) -export GOELAND_brew_k8s_formulaes=( +export GLD_brew_k8s_formulaes=( "kubectl" "kubectx" "kubeseal" "helm" ) -export GOELAND_dotfiles=( - "aliases" - "functions" -) - -export GOELAND_omz_plugins=( +export GLD_omz_plugins=( "zsh-autosuggestions" "zsh-completions" "zsh-history-substring-search" "zsh-syntax-highlighting" ) -export GOELAND_vscode_extensions=( +export GLD_vscode_extensions=( "ms-azuretools.vscode-docker" "dracula-theme.theme-dracula" "eamodio.gitlens" diff --git a/config/files/aliases.sh b/config/files/aliases.sh index 26a7afc..a614890 100644 --- a/config/files/aliases.sh +++ b/config/files/aliases.sh @@ -11,7 +11,7 @@ alias del="rm -rf" alias e="exit" alias m="make" alias rf='source $HOME/.zshrc' -alias sn="snap" +alias s="snap" alias t="touch" # FUNCTIONS BIND --------------------------------------------------------- diff --git a/config/utils.sh b/config/utils.sh index 2feae13..75d3775 100644 --- a/config/utils.sh +++ b/config/utils.sh @@ -3,45 +3,50 @@ # shellcheck source=/dev/null source "$PWD"/config/config.sh -function _GOELAND_apt_packages_install () { - ARRAY=$@ +function GLD_apt_packages_install () { + ARRAY=$* for i in $ARRAY; do if ! command -v "$i" &> /dev/null; then + ui_info "installing \"$i\" binary" exec=(sudo apt install "$i" -y) else - ui_info "\"$i\" command already exist. Skipping.." + ui_info "upgrade \"$i\" binary because already exist" + exec=(sudo apt upgrade "$i" -y) fi ui_cmd "${exec[@]}" ; "${exec[@]}" done } -function GOELAND_brew_formulaes_install () { - ARRAY=$@ +function GLD_brew_formulaes_install () { + ARRAY=$* for i in $ARRAY; do if ! command -v "$i" &> /dev/null; then + ui_info "installing \"$i\" binary" exec=(brew install "$i") else - ui_info "\"$i\" command already exist. Upgrading.." + ui_info "upgrade \"$i\" binary because already exist" exec=(brew upgrade "$i") fi ui_cmd "${exec[@]}" ; "${exec[@]}" done } -function GOELAND_snap_packages_install () { - for ((i = 0; i < ${#GOELAND_snap_packages[@]}; i++)) ; do - if ! command -v "${GOELAND_snap_packages[$i]}" &> /dev/null; then - exec=(sudo snap install "${GOELAND_snap_packages[$i]}") +function GLD_snap_packages_install () { + + for ((i = 0; i < ${#GLD_snap_packages[@]}; i++)) ; do + if ! command -v "${GLD_snap_packages[$i]}" &> /dev/null; then + ui_info "installing \"${GLD_snap_packages[$i]}\" binary" + exec=(sudo snap install "${GLD_snap_packages[$i]}") else - ui_info "\"${GOELAND_snap_packages[$i]}\" command already exist. Refreshing.." - exec=(sudo snap refresh "${GOELAND_snap_packages[$i]}") + ui_info "upgrade \"${GLD_snap_packages[$i]}\" binary because already exist" + exec=(sudo snap refresh "${GLD_snap_packages[$i]}") fi ui_cmd "${exec[@]}" ; "${exec[@]}" done } -function GOELAND_vscode_extensions_install () { - ARRAY=$@ +function GLD_vscode_extensions_install () { + ARRAY=$* for i in $ARRAY; do if ! command -v "$i" &> /dev/null; then exec=(code --install-extension "$i")