Skip to content

Commit

Permalink
feat: Many small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Pilaton committed Nov 22, 2023
1 parent 237e502 commit 47118a5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ on:
push:
branches:
- main

name: 🚀 release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: 🕺 release
uses: GoogleCloudPlatform/release-please-action@v2
uses: GoogleCloudPlatform/release-please-action@v3
id: release
with:
release-type: simple
Expand Down
25 changes: 13 additions & 12 deletions ohmyzsh-full-autoupdate.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fi
#######################################
# Set colors if "tput" is present in the system
#######################################
if [[ ! -z $(which tput 2> /dev/null) ]]; then
if [[ -n $(command -v tput) ]]; then
bold=$(tput bold)
colorGreen=$(tput setaf 2)
colorYellow=$(tput setaf 3)
Expand Down Expand Up @@ -76,8 +76,8 @@ printf '\n'
# [text...] Url
#######################################
_getUrlGithub() {
local URL=$(grep 'url =' "${1}/config" | grep -o 'https://\S*' | sed 's/\.git//')
echo $URL
local url=$(grep 'url =' "$1/config" | grep -o 'https://\S*' | sed 's/\.git//')
echo $url
}

#######################################
Expand All @@ -88,9 +88,10 @@ _getUrlGithub() {
# [text...] Name category
#######################################
_getNameCustomCategory() {
case ${1} in
*"plugins"*) echo "Plugin" ; return 0 ;;
*"themes"*) echo "Theme" ; return 0 ;;
local path=$1
case $path in
*"plugins"*) echo "Plugin" ;;
*"themes"*) echo "Theme" ;;
esac
}

Expand All @@ -101,7 +102,6 @@ _getNameCustomCategory() {
#######################################
_savingLabel() {
echo "\nLABEL_FULL_AUTOUPDATE=true" >> "${ZSH_CACHE_DIR}/.zsh-update"
return 0
}

#######################################
Expand All @@ -110,20 +110,21 @@ _savingLabel() {
# ZSH_CUSTOM
#######################################
omzFullUpdate() {
local arrayPackages=( $(find -L "${ZSH_CUSTOM}" -type d -name ".git") )
local arrayPackages=($(find -L "${ZSH_CUSTOM}" -type d -name ".git"))

for package in ${arrayPackages[@]}; do
local urlGithub=$(_getUrlGithub "$package")
local nameCustomCategory=$(_getNameCustomCategory "$package")
local packageDir=$(dirname "$package")
local packageName=$(basename "$packageDir")

echo "${colorYellow}Updating ${nameCustomCategory}${reset}${colorGreen}${packageName}${reset} -> ${colorBlue}($urlGithub)${reset}"
git -C "${packageDir}" pull
echo ""
printf '%sUpdating %s — %s -> %s\n' "$colorYellow" "$nameCustomCategory" "$colorGreen$packageName$reset" "$colorBlue$urlGithub$reset"
if ! git -C "$packageDir" pull; then
printf '%sError updating %s%s\n' "$colorRed" "$packageName" "$reset"
fi
printf '\n'
done

# Start the function of saving the label
_savingLabel
}
omzFullUpdate

0 comments on commit 47118a5

Please sign in to comment.