Skip to content

Commit b1844cd

Browse files
committed
chore(release): version 5.3.4
1 parent e39f1f1 commit b1844cd

File tree

5 files changed

+37
-42
lines changed

5 files changed

+37
-42
lines changed

.zshrc

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export MYZS_LOADING_PLUGINS=(
2323
# "myzs-plugins/macos#master"
2424

2525
# "myzs-plugins/thefuck#master"
26+
"myzs-plugins/python#main"
2627
# "myzs-plugins/nodejs#master"
2728
# "myzs-plugins/docker#master"
2829
# "kamontat/mplugin-kamontat#master"

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Release notes
22

3+
## Version 5.3.4 (10 May 2021)
4+
5+
- add logging when checking os and shell
6+
- upgrade app/gcloud.sh to support latest version
7+
- add new plugin `myzs-plugins/python` for conda support
8+
- now plugin default branch will be **main** instead of **master**
9+
310
## Version 5.3.3 (21 Apr 2021)
411

512
- add error progress when zplug load failed

init.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ export __MYZS__COM="${_MYZS_ROOT}/resources/completion"
99
export ZPLUG_HOME="${MYZS_ZPLUG:-${_MYZS_ROOT}/zplug}"
1010

1111
export __MYZS__OWNER="Kamontat Chantrachirathumrong"
12-
export __MYZS__VERSION="5.3.3"
12+
export __MYZS__VERSION="5.3.4"
1313
export __MYZS__SINCE="21 Apr 2018"
14-
export __MYZS__LAST_UPDATED="21 Apr 2021"
14+
export __MYZS__LAST_UPDATED="10 May 2021"
1515
export __MYZS__LICENSE="MIT"
1616

1717
export __MYZS__MODULES=()

src/app/gcloud.sh

+25-40
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,33 @@
22

33
_myzs:internal:module:initial "$0"
44

5-
initial() {
6-
local _gcloud_default_name="${1:-google-cloud-sdk}"
7-
8-
local _gcloud_default1="/opt" # application location
9-
local _gcloud_default2="/usr/local/Cellar" # homebrew location
10-
local _gcloud_default3="/usr/local/bin" # legacy location
11-
12-
_myzs:internal:checker:folder-exist "$_gcloud_default1/${_gcloud_default_name}" &&
13-
export __MYZS__DEFAULT_GCLOUD_LOCATION="$_gcloud_default1/${_gcloud_default_name}"
14-
15-
_myzs:internal:checker:folder-exist "$_gcloud_default2/${_gcloud_default_name}" &&
16-
export __MYZS__DEFAULT_GCLOUD_LOCATION="$_gcloud_default2/${_gcloud_default_name}"
17-
18-
_myzs:internal:checker:folder-exist "$_gcloud_default3/${_gcloud_default_name}" &&
19-
export __MYZS__DEFAULT_GCLOUD_LOCATION="$_gcloud_default3/${_gcloud_default_name}"
20-
21-
_myzs:internal:checker:folder-exist "${_gcloud_default_name}" &&
22-
export __MYZS__DEFAULT_GCLOUD_LOCATION="${_gcloud_default_name}"
23-
24-
local current_path="${__MYZS__DEFAULT_GCLOUD_LOCATION}"
25-
_myzs:internal:checker:command-exist "gcloud" &&
26-
current_path="$(dirname "$(dirname "$(which gcloud)")")"
27-
28-
local gcloud_path="${current_path:-$default_path}"
29-
30-
_myzs:internal:path-push "${gcloud_path}/bin"
31-
# The next line enables shell command completion for gcloud.
32-
_myzs:internal:load "Google Cloud SDK path" "${gcloud_path}/completion.$(_myzs:internal:shell).inc"
5+
_myzs:private:gcloud:initial() {
6+
local _local_shell _gcloud_fullpath
7+
_local_shell="$(_myzs:internal:shell)"
8+
local _path_filename="path.$_local_shell.inc"
9+
local _completion_filename="completion.$_local_shell.inc"
10+
local _gcloud_default_name="google-cloud-sdk"
11+
local _gcloud_paths=(
12+
"/opt"
13+
"/usr/local/Cellar"
14+
"/usr/local/bin"
15+
"/usr/local/etc"
16+
)
17+
18+
export __MYZS__DEFAULT_GCLOUD_DIRPATH=""
19+
for _gcloud_path in "${_gcloud_paths[@]}"; do
20+
_gcloud_fullpath="$_gcloud_path/$_gcloud_default_name"
21+
if _myzs:internal:checker:folder-exist "$_gcloud_fullpath"; then
22+
__MYZS__DEFAULT_GCLOUD_DIRPATH="$_gcloud_fullpath"
23+
fi
24+
done
3325

34-
if ! _myzs:internal:checker:command-exist "gcloud"; then
35-
if _myzs:internal:checker:string-exist "$__MYZS__DEFAULT_GCLOUD_LOCATION"; then
36-
_myzs:internal:log:info "loading gcloud from ${__MYZS__DEFAULT_GCLOUD_LOCATION}"
26+
if _myzs:internal:checker:string-exist "$__MYZS__DEFAULT_GCLOUD_DIRPATH"; then
27+
_myzs:internal:log:debug "loading gcloud from ${__MYZS__DEFAULT_GCLOUD_DIRPATH}"
3728

38-
local install_path="${__MYZS__DEFAULT_GCLOUD_LOCATION}/install.sh"
39-
$install_path
40-
else
41-
_myzs:internal:log:info "cannot found gcloud-sdk location, create \$MYZS_GCLOUD_LOCATION and point to gcloud-sdk location path"
42-
_myzs:internal:failed 2
43-
fi
44-
else
45-
_myzs:internal:log:info "command gcloud already existed, skip initial"
29+
_myzs:internal:load "Google Cloud SDK path" "$__MYZS__DEFAULT_GCLOUD_DIRPATH/$_path_filename"
30+
_myzs:internal:load "Google Cloud SDK completion" "$__MYZS__DEFAULT_GCLOUD_DIRPATH/$_completion_filename"
4631
fi
4732
}
4833

49-
initial "$MYZS_GCLOUD_LOCATION"
34+
_myzs:private:gcloud:initial

src/utils/helper/checker.sh

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ fi
66

77
_myzs:private:checker:shell() {
88
if grep -q "$1" <<<"$SHELL"; then
9+
_myzs:internal:log:debug "You loading on $SHELL"
910
return 0
1011
else
1112
return 1
@@ -87,6 +88,7 @@ _myzs:internal:checker:mac() {
8788
local name
8889
name="$(uname -s)"
8990
if [[ "$name" = "Darwin" ]]; then
91+
_myzs:internal:log:debug "You loading on MacOS"
9092
return 0
9193
else
9294
return 1

0 commit comments

Comments
 (0)