Skip to content

Commit

Permalink
upd(vars): #14 - GLD vars
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-delaloy committed Jul 15, 2022
1 parent 7f83694 commit a93dc5e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 26 deletions.
23 changes: 12 additions & 11 deletions config/config.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -11,14 +16,15 @@ export GOELAND_apt_packages=(
"htop"
"make"
"procps"
"shellcheck"
"software-properties-common"
"tree"
"virtualbox"
"xclip"
"zsh"
)

export GOELAND_snap_packages=(
export GLD_snap_packages=(
"code --classic"
"discord"
"gimp"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion config/files/aliases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---------------------------------------------------------
Expand Down
33 changes: 19 additions & 14 deletions config/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit a93dc5e

Please sign in to comment.