Skip to content

Commit 0e4bf3f

Browse files
authored
Merge branch 'main' into claude/issue-17-20251210-1410
2 parents 9efb460 + 53f5a6f commit 0e4bf3f

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

lib/lazy-loader.zsh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,18 @@ _zush_do_tool_initialization() {
8585
zush_lazy_load() {
8686
local tool=$1
8787
local init_command=$2
88+
89+
# Validate required parameters
90+
if [[ -z "$tool" ]]; then
91+
zush_error "zush_lazy_load: tool name is required (got: '$tool')"
92+
return 1
93+
fi
94+
95+
if [[ -z "$init_command" ]]; then
96+
zush_error "zush_lazy_load: init command is required (got: '$init_command')"
97+
return 1
98+
fi
99+
88100
shift 2
89101
local -a commands=("$@")
90102

lib/plugin.zsh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,17 @@ _zushp_add_to_manifest() {
7676
# Main plugin function
7777
zushp() {
7878
local user_repo="$1"
79-
80-
[[ -z "$user_repo" ]] && { echo "Usage: zushp <user/repo>"; return 1; }
79+
80+
# Validate user/repo format
81+
if [[ -z "$user_repo" ]]; then
82+
zush_error "Usage: zushp <user/repo> (got: '$user_repo')"
83+
return 1
84+
fi
85+
86+
if [[ ! "$user_repo" =~ ^[a-zA-Z0-9_-]+/[a-zA-Z0-9_.-]+$ ]]; then
87+
zush_error "Invalid format. Use: zushp <user/repo> (got: '$user_repo')"
88+
return 1
89+
fi
8190

8291
local plugin_name="${user_repo##*/}"
8392
local plugin_dir="${ZUSH_PLUGINS_DIR}/${plugin_name}"

rc.d/50-editor.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Sets up editor preferences based on environment
33

44
# Use VS Code if local (with -w to wait), vim if remote
5-
if [[ -z "$SSH_CONNECTION" ]] && command -v code >/dev/null 2>&1; then
5+
if [[ -z "$SSH_CONNECTION" ]] && (( ${+commands[code]} )); then
66
export EDITOR="code -w"
77
export VISUAL="code -w"
88
else

rc.d/84-git-worktrees.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ _gwt_message() {
107107
}
108108

109109
_gwt_require_git() {
110-
if ! command -v git >/dev/null 2>&1; then
110+
if ! (( ${+commands[git]} )); then
111111
_gwt_error "git is not available"
112112
return 1
113113
fi

0 commit comments

Comments
 (0)