Skip to content

Commit

Permalink
[release] version: 4.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kamontat committed Jun 18, 2020
1 parent 63157e7 commit 71db450
Show file tree
Hide file tree
Showing 37 changed files with 269 additions and 179 deletions.
3 changes: 2 additions & 1 deletion .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ export SAVEHIST=$HISTSIZE
################################

# This is tell terminal to know what is default shell
export SHELL="/usr/local/bin/zsh"
DEFAULT_SHELL="/usr/local/bin/zsh"
export DEFAULT_SHELL

# System call, leave it alone
if test -f "${MYZS_ROOT}/init.sh"; then
Expand Down
64 changes: 41 additions & 23 deletions init.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,45 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi

export __MYZS_ROOT="${MYZS_ROOT:-"$HOME/.myzs"}"
export __MYZS_SOURCE_CODE="${__MYZS_ROOT}/src"
export __MYZS_RESOURCES="${__MYZS_ROOT}/resources"
export __MYZS_ZPLUG="${ZPLUG_HOME:-${__MYZS_ROOT}/zplug}"

export __MYZS_USER="${MYZS_USER:-$USER}"
export __MYZS_OWNER="Kamontat Chantrachirathumrong"
export __MYZS_VERSION="4.4.0"
export __MYZS_VERSION="4.5.0"
export __MYZS_SINCE="21 Apr 2018"
export __MYZS_LAST_UPDATED="01 Jun 2020"
export __MYZS_LAST_UPDATED="18 Jun 2020"
export __MYZS_LICENSE="MIT"
export __MYZS_MODULES=()

export __MYZS_CHANGELOGS=(
"[4.4.0](01 Jun 2020){add substring history search and more alias and application}"
"[4.3.0](24 Apr 2020){add modules and start command}"
"[4.2.0](15 Apr 2020){add skipping process and more customizable}"
"[4.1.1](04 Feb 2020){add documentation and change some default value}"
"[4.1.0](31 Dec 2019){add more alias, fix some log detail missing, update path to avoid duplication}"
"[4.0.0](23 Sep 2019){first v4.x.x released}"
"4.5.0" "18 Jun 2020"
" - Introduce new command 'myzs-info' for print myzs information
- Introduce new command 'myzs-list-changelogs' for print myzs changelogs
- Add filename to log message
- Change log files location to /tmp/myzs/logs
- Rename logfile variable from \$MYZS_LOGFILE to \$MYZS_LOGPATH
- Update new changelog format"
"4.4.0" "01 Jun 2020"
" - Add substring history search plugins
- Add more alias and application"
"4.3.0" "24 Apr 2020"
" - Add modules loaded
- Add new myzs command myzs-list-modules
- Add start command"
"4.2.0" "15 Apr 2020"
" - Add skipping process
- Add new customizable settings"
"4.1.1" "04 Feb 2020"
" - Add documentation
- Change some default value"
"4.1.0" "31 Dec 2019"
" - Add more alias
- Fix log detail missing
- Fix duplicate \$PATH variable"
"4.0.0" "23 Sep 2019"
" - First v4.x.x released"
)

# Accept values: FULLY | SMALL
Expand All @@ -39,6 +55,8 @@ export REVOLVER_CMD="${__MYZS_SOURCE_CODE}/utils/revolver"

source "${__MYZS_SOURCE_CODE}/utils/helper.sh"

__myzs_initial

if __myzs_is_fully; then
source "${__MYZS_SOURCE_CODE}/utils/progress.sh"
else
Expand All @@ -48,35 +66,35 @@ fi
pg_start

pg_mark "Commandline" "setup system settings"
__myzs_load "System variable" "${__MYZS_SOURCE_CODE}/settings/system.sh" || pg_mark_false "Cannot load system variable"
__myzs_load_module "system.sh" "${__MYZS_SOURCE_CODE}/settings/system.sh" || pg_mark_false "Cannot load system variable"

if __myzs_is_fully; then
pg_mark "Commandline" "setup commandline settings"
__myzs_load "ZSH settings" "${__MYZS_SOURCE_CODE}/settings/zsh.sh" || pg_mark_false "Cannot load zsh settings"
__myzs_load_module "zsh.sh" "${__MYZS_SOURCE_CODE}/settings/zsh.sh" || pg_mark_false "Cannot load zsh settings"
fi

if __myzs_is_fully; then
if __myzs_is_fully && __myzs_shell_is_zsh; then
pg_mark "Plugin" "setup plugin manager"
__myzs_load "ZPLUG initial script" "${__MYZS_ZPLUG}/init.zsh" || pg_mark_false "Cannot load zplug initial script"
__myzs_load_module "zplug/init.zsh" "${__MYZS_ZPLUG}/init.zsh" || pg_mark_false "Cannot load zplug initial script"
fi

if __myzs_is_fully; then
if __myzs_is_fully && __myzs_shell_is_zsh; then
pg_mark "Plugin" "Loading plugins from zplug"
__myzs_load "Plugins list" "${__MYZS_SOURCE_CODE}/settings/plugins.sh" || pg_mark_false "Cannot load zplug plugins list"
__myzs_load_module "plugins.sh" "${__MYZS_SOURCE_CODE}/settings/plugins.sh" || pg_mark_false "Cannot load zplug plugins list"

__myzs__create_plugins # create plugins

# Install plugins if there are plugins that have not been installed
if ! zplug check --verbose; then
printf "Install? [y/N]: "
if read -q; then
if read -rq; then
echo
zplug install
fi
fi

# load new plugins to system
zplug load --verbose >>"$__MYZS_ZPLUG_LOGFILE"
zplug load --verbose >>"$MYZS_ZPLUG_LOGPATH"
fi

pg_mark "Helper" "Loading application setup script"
Expand Down Expand Up @@ -111,9 +129,7 @@ done

pg_stop

if __myzs_is_fully; then
__myzs_load "environment file" "$MYZS_ROOT/.env"
fi
__myzs_load "environment file" "$MYZS_ROOT/.env"

if __myzs_is_fully; then
# auto open path from clipboard
Expand All @@ -137,3 +153,5 @@ if __myzs_is_fully; then
$MYZS_START_COMMAND "${MYZS_START_COMMAND_ARGUMENTS[@]}"
fi
fi

__myzs_cleanup
4 changes: 1 addition & 3 deletions src/alias/agoda.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

__agoda_kube() {
confpath="${1:-$HOME/.kube/config}"
Expand Down
4 changes: 1 addition & 3 deletions src/alias/coreutils.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

if __myzs_is_command_exist "gdate"; then
__myzs_alias "date" "gdate"
Expand Down
4 changes: 1 addition & 3 deletions src/alias/docker.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

if __myzs_is_command_exist "docker-compose"; then
__myzs_alias "dcb" "docker-compose build"
Expand Down
4 changes: 1 addition & 3 deletions src/alias/editor.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

if __myzs_is_command_exist "code-insiders"; then
__myzs_alias "code" "code-insiders"
Expand Down
4 changes: 1 addition & 3 deletions src/alias/fuck.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

if __myzs_is_command_exist "fuck"; then
__myzs_alias "f" "fuck"
Expand Down
4 changes: 1 addition & 3 deletions src/alias/generator.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

if __myzs_is_command_exist "generator"; then
__myzs_alias "template" "generator"
Expand Down
4 changes: 1 addition & 3 deletions src/alias/git.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

if __myzs_is_command_exist "git"; then
if __myzs_is_command_exist "hub"; then
Expand Down
4 changes: 1 addition & 3 deletions src/alias/github.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

__myzs_alias "color-test" "bash <(curl -sL https://raw.githubusercontent.com/kamontat/bash-color/master/color_test.sh)"
__myzs_alias "split-image" "bash <(curl -sL https://gist.githubusercontent.com/kamontat/97ea3378c5d323b9b430aeda8b5f80df/raw/dbda55f2cadc0481b3a27f4ffc13602c6b7ffe8f/sep.sh)"
4 changes: 1 addition & 3 deletions src/alias/mac.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

if [ "$(uname -s)" = "Darwin" ] && __myzs_is_command_exist "osascript"; then
newtab() {
Expand Down
4 changes: 1 addition & 3 deletions src/alias/neofetch.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

if __myzs_is_command_exist "neofetch"; then
if __myzs_is_file_exist "$NEOFETCH_CONFIG"; then
Expand Down
4 changes: 1 addition & 3 deletions src/alias/shell.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

__myzs_alias "restart-zsh" "exec zsh"
__myzs_alias "restart-bash" "exec bash"
Expand Down
4 changes: 1 addition & 3 deletions src/alias/short.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

__myzs_alias "c" "clear"

Expand Down
4 changes: 1 addition & 3 deletions src/alias/vim.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

if __myzs_is_command_exist "nvim"; then
__myzs_alias "v" "nvim"
Expand Down
4 changes: 1 addition & 3 deletions src/alias/yarn.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

if __myzs_is_command_exist "yarn"; then
__myzs_alias "y" "yarn"
Expand Down
6 changes: 2 additions & 4 deletions src/app/android.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

if __myzs_is_folder_exist "$HOME/Library/Android/sdk"; then
export ANDROID_HOME="$HOME/Library/Android/sdk" # android home
export ANDROID_HOME="$HOME/Library/Android/sdk" # android home
export PATH="${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools" # android path
fi
7 changes: 3 additions & 4 deletions src/app/asdf.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

if __myzs_is_command_exist "asdf"; then
export ASDF_HOME="$(brew --prefix asdf)"
ASDF_HOME="$(brew --prefix asdf)"
export ASDF_HOME

# Install via Homebrew
__myzs_load "ASDF setup script" "$ASDF_HOME/asdf.sh"
Expand Down
4 changes: 1 addition & 3 deletions src/app/docker.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

export DOCKER_COMPLETION="$HOME/.myzs/zplug/repos/zsh-users/zsh-completions/src/_docker"
export DOCKER_COMPOSE_COMPLETION="$HOME/.myzs/zplug/repos/zsh-users/zsh-completions/src/_docker-compose"
Expand Down
4 changes: 1 addition & 3 deletions src/app/flutter.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

export FLUTTER_HOME="/usr/local/opt/flutter"

Expand Down
4 changes: 1 addition & 3 deletions src/app/fzf.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

__myzs_load "fezzy search script" "$HOME/.fzf.zsh"
4 changes: 1 addition & 3 deletions src/app/go.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

export GOPATH="${__GOPATH:-$HOME/Desktop/Personal/go}"

Expand Down
4 changes: 1 addition & 3 deletions src/app/history.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

if ! __myzs_is_plugin_installed "zsh-users/zsh-history-substring-search"; then
__myzs_complete
Expand Down
4 changes: 1 addition & 3 deletions src/app/iterm.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

export __ITERM_INTEGRATION="${HOME}/.iterm2_shell_integration.zsh"

Expand Down
4 changes: 1 addition & 3 deletions src/app/macgpg.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# shellcheck disable=SC1090,SC2148

if [[ "$MYZS_DEBUG" == "true" ]]; then
set -x # enable DEBUG MODE
fi
__myzs_initial "$0"

export MACGPG_BIN="/usr/local/MacGPG2/bin"
__myzs_append_path "$MACGPG_BIN"
Loading

0 comments on commit 71db450

Please sign in to comment.