From 412c12bc1bc55b001ef9958351dad4f156793c7d Mon Sep 17 00:00:00 2001 From: Pilaton Date: Thu, 14 Dec 2023 14:18:50 +0300 Subject: [PATCH] fix(stylistics): Corrected indentation in the code --- .editorconfig | 2 +- .github/workflows/ci.yml | 15 ++++++++ .github/workflows/release-please.yml | 17 --------- README.md | 16 ++++----- ohmyzsh-full-autoupdate.plugin.zsh | 54 ++++++++++++++-------------- 5 files changed, 51 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/release-please.yml diff --git a/.editorconfig b/.editorconfig index 2087dd7..8f5d808 100644 --- a/.editorconfig +++ b/.editorconfig @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e0ab4aa --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index 235e482..0000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,17 +0,0 @@ -on: - push: - branches: - - main - -name: 🚀 release-please -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - name: 🕺 release - uses: GoogleCloudPlatform/release-please-action@v3 - id: release - with: - release-type: simple - changelog-types: '[{"type":"feat","section":"🎉 Features","hidden":false},{"type":"fix","section":"🛠️ Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]' - token: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index d7da2ab..ce6942d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ## 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. @@ -18,15 +18,15 @@ This plugin solves this problem and automatically updates your plugins and theme 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. @@ -34,7 +34,7 @@ This plugin solves this problem and automatically updates your plugins and theme 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`. diff --git a/ohmyzsh-full-autoupdate.plugin.zsh b/ohmyzsh-full-autoupdate.plugin.zsh index a63da01..8f6576a 100644 --- a/ohmyzsh-full-autoupdate.plugin.zsh +++ b/ohmyzsh-full-autoupdate.plugin.zsh @@ -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 ####################################### @@ -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 } ####################################### @@ -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 } ####################################### @@ -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" } ####################################### @@ -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