Skip to content

Commit

Permalink
chore(release): version 5.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
kamontat committed Apr 21, 2021
1 parent a5ff733 commit e39f1f1
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 16 deletions.
3 changes: 1 addition & 2 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ export MYZS_LOADING_SETTINGS=(
## Override zplug plugins list.
## NOTES: This will remove all plugins from src/settings/plugins.sh except 'zplug/zplug'
## Uncommand function below
# export myzs:zplug:plugin-list
# myzs:zplug:plugin-list() {
# myzs:zplug:custom:plugin-list() {
# zplug "zsh-users/zsh-autosuggestions"
# }

Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Release notes

## Version 5.3.3 (21 Apr 2021)

- add error progress when zplug load failed
- add error progress when configured zplug failed
- add error when loading module with error and `pb/performance` is enabled
- change custom zplug plugins list name from `myzs:zplug:plugin-list` to `myzs:zplug:custom:plugin-list`
- fix not color final message from progressbar
- fix `source "$file"` return zero even error occurred

## Version 5.3.2 (21 Apr 2021)

- fix `/tmp/myzs` didn't create for data and log path
Expand Down
4 changes: 2 additions & 2 deletions LOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

| Language | files | blank | comment | code |
| :----------- | -------: | -------: | -------: | -------: |
| Bourne Shell | 56 | 648 | 327 | 2099 |
| Bourne Shell | 57 | 666 | 333 | 2166 |
| zsh | 1 | 47 | 73 | 198 |
| YAML | 2 | 2 | 9 | 48 |
| -------- | -------- | -------- | -------- | -------- |
| SUM: | 59 | 697 | 409 | 2345 |
| SUM: | 60 | 715 | 415 | 2412 |

> generate from `cloc --fullpath . --not-match-d "(zplug)" --not-match-f ".md" --md`
12 changes: 8 additions & 4 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export __MYZS__COM="${_MYZS_ROOT}/resources/completion"
export ZPLUG_HOME="${MYZS_ZPLUG:-${_MYZS_ROOT}/zplug}"

export __MYZS__OWNER="Kamontat Chantrachirathumrong"
export __MYZS__VERSION="5.3.2"
export __MYZS__VERSION="5.3.3"
export __MYZS__SINCE="21 Apr 2018"
export __MYZS__LAST_UPDATED="21 Apr 2021"
export __MYZS__LICENSE="MIT"
Expand Down Expand Up @@ -74,18 +74,22 @@ if _myzs:internal:checker:fully-type && _myzs:internal:checker:shell:zsh && _myz

myzs:pg:mark "ZPlugin" "Loading zplug plugin list"
# load new plugins to system
zplug load --verbose >>"$MYZS_ZPLUG_LOGPATH"
if ! zplug load --verbose >>"$MYZS_ZPLUG_LOGPATH"; then
myzs:pg:mark-fail "Cannot load zplug plugin"
fi

myzs:pg:mark "ZPlugin" "Setup zplug plugin config"
myzs:zplug:setup-plugins
if ! myzs:zplug:setup-plugins; then
myzs:pg:mark-fail "Cannot configure zplug plugin"
fi
fi

# load myzs plugins
myzs:pg:mark "Plugin" "Initial myzs plugin list"
for plugin in "${MYZS_LOADING_PLUGINS[@]}"; do
myzs:pg:mark "Plugin" "Downloading ${plugin} plugin"
if ! _myzs:internal:plugin:name-deserialize "$plugin" _myzs:internal:plugin:load; then
myzs:pg:mark-fail "Cannot load plugin"
myzs:pg:mark-fail "Cannot load myzs plugin"
fi
done

Expand Down
4 changes: 2 additions & 2 deletions src/settings/plugins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ _myzs:internal:module:initial "$0"
myzs:zplug:initial-plugins() {
zplug 'zplug/zplug', hook-build:'zplug --self-manage'

if _myzs:internal:checker:command-exist "myzs:zplug:plugin-list"; then
myzs:zplug:plugin-list
if _myzs:internal:checker:command-exist "myzs:zplug:custom:plugin-list"; then
myzs:zplug:custom:plugin-list
else
# Require libraries
zplug "mafredri/zsh-async", from:github, use:"async.zsh"
Expand Down
7 changes: 3 additions & 4 deletions src/utils/helper/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,16 @@ _myzs:internal:load() {
local args=("$@")

if _myzs:internal:checker:file-exist "$filepath"; then

_myzs:internal:log:debug "source ${filepath} with '${args[*]}'"
source "${filepath}" "${args[@]}"
exitcode=$?
if [[ "$exitcode" != "0" ]]; then
_myzs:internal:log:error "Cannot load ${filename} (${filepath}) because source return $exitcode"
_myzs:internal:failed "$exitcode"
else
_myzs:internal:log:info "Loaded ${filename} (${filepath}) to the system"
_myzs:internal:completed
fi

_myzs:internal:log:info "Loaded ${filename} (${filepath}) to the system"
_myzs:internal:completed
else
_myzs:internal:log:warn "Cannot load ${filename} (${filepath}) because file is missing"
_myzs:internal:failed 4
Expand Down
7 changes: 5 additions & 2 deletions src/utils/progress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ _myzs:pg:private:message() {
fi

printf "${color}[%s]${PG_RESET} %-$(myzs:setting:get "pb/message/length")s done in ${time_color}%s${PG_RESET}." "$symbol" "$message" "$dur"

}

_myzs:pg:private:log:completed() {
Expand Down Expand Up @@ -128,6 +127,10 @@ myzs:pg:mark() {
myzs:pg:mark-fail() {
PG_PREV_STATE="F"
PG_PREV_MSG=$(_myzs:pg:private:message:format "Error" "$1")

if ! _myzs:internal:setting:is-enabled "pb/performance"; then
_myzs:pg:private:log "$PG_PREV_STATE" "$TIME" "$PG_PREV_MSG"
fi
}

myzs:pg:mark-skip() {
Expand All @@ -149,7 +152,7 @@ myzs:pg:stop() {
TIME=$(($(_myzs:pg:private:time:ms) - PG_START_TIME))
load_time="$(_myzs:pg:private:time:convert "${TIME}")"

printf "${MYZS_PG_COMPLETE_CL}[+]${PG_RESET} %-$(myzs:setting:get "pb/message/length")s in ${MYZS_PG_TIME_CL}%s${PG_RESET}." "$(_myzs:pg:private:message:format "Completed" "Initialization $__MYZS__PG_PROCESS_COUNT tasks")" "${load_time}"
printf "$(myzs:setting:get "pb/color/completed")[+]${PG_RESET} %-$(myzs:setting:get "pb/message/length")s in $(myzs:setting:get "pb/color/time")%s${PG_RESET}." "$(_myzs:pg:private:message:format "Completed" "Initialization $__MYZS__PG_PROCESS_COUNT tasks")" "${load_time}"
echo

export PROGRESS_COUNT="${__MYZS__PG_PROCESS_COUNT}"
Expand Down

0 comments on commit e39f1f1

Please sign in to comment.