Skip to content

Commit

Permalink
fix(stylistics): Corrected indentation in the code
Browse files Browse the repository at this point in the history
  • Loading branch information
Pilaton committed Dec 14, 2023
1 parent a3448b1 commit 412c12b
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ root = true

[*]
indent_style = space
indent_size = 4
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 🚀 release

on:
push:
branches:
- main

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: 🕺 release
uses: GoogleCloudPlatform/release-please-action@v4
with:
release-type: simple
17 changes: 0 additions & 17 deletions .github/workflows/release-please.yml

This file was deleted.

16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@

## What is it

As you probably know, when you update Oh My Zsh, your plugins and themes installed in the `~/.oh-my-zsh/custom` folder are not updated.
As you probably know, when you update Oh My Zsh, your plugins and themes installed in the `~/.oh-my-zsh/custom` folder are not updated.

This plugin solves this problem and automatically updates your plugins and themes.

## Installing

1. Clone this repository into `$ZSH_CUSTOM/plugins` (`~/.oh-my-zsh/custom/plugins`)

```bash
git clone https://github.com/Pilaton/OhMyZsh-full-autoupdate.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/ohmyzsh-full-autoupdate
```
```bash
git clone https://github.com/Pilaton/OhMyZsh-full-autoupdate.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/ohmyzsh-full-autoupdate
```

2. Add the plugin to the Oh My Zsh plugin list in the `~/.zshrc` file:

```bash
plugins=(... ohmyzsh-full-autoupdate)
```
```bash
plugins=(... ohmyzsh-full-autoupdate)
```

3. Start a new terminal session.

## Usage 🚀

The plugin **works completely automatically**.
The update of all OMZ themes and plugins is triggered the next time a new terminal session is opened, after the update of Oh My Zsh.
The update frequency depends on the Oh My Zsh settings, by default every 13 days.
The update frequency depends on the Oh My Zsh settings, by default every 13 days.

💡 Note: It can be changed with the parameter `export UPDATE_ZSH_DAYS=13` in `~/.zshrc`.

Expand Down
54 changes: 27 additions & 27 deletions ohmyzsh-full-autoupdate.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@
# If our label exists in the file "${ZSH_CACHE_DIR}/.zsh-update", skip updating plugins and themes
#######################################
if [[ $(grep "LABEL_FULL_AUTOUPDATE" "${ZSH_CACHE_DIR}/.zsh-update") ]]; then
return
return
fi

#######################################
# Set colors if "tput" is present in the system
#######################################
if [[ -n $(command -v tput) ]]; then
bold=$(tput bold)
colorGreen=$(tput setaf 2)
colorYellow=$(tput setaf 3)
colorBlue=$(tput setaf 4)
reset=$(tput sgr0)
bold=$(tput bold)
colorGreen=$(tput setaf 2)
colorYellow=$(tput setaf 3)
colorBlue=$(tput setaf 4)
reset=$(tput sgr0)
fi

#######################################
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,11 +88,11 @@ _getUrlGithub() {
# [text...] Name category
#######################################
_getNameCustomCategory() {
local path=$1
case $path in
*"plugins"*) echo "Plugin" ;;
*"themes"*) echo "Theme" ;;
esac
local path=$1
case $path in
*"plugins"*) echo "Plugin" ;;
*"themes"*) echo "Theme" ;;
esac
}

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

#######################################
Expand All @@ -110,21 +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")
for package in ${arrayPackages[@]}; do
local urlGithub=$(_getUrlGithub "$package")
local nameCustomCategory=$(_getNameCustomCategory "$package")
local packageDir=$(dirname "$package")
local packageName=$(basename "$packageDir")

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
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

_savingLabel
_savingLabel
}
omzFullUpdate

0 comments on commit 412c12b

Please sign in to comment.