fix(shell): address shellcheck warnings, standardize error handling, add retry logic #253
Reference in New Issue
Block a user
Delete Branch "fix/issue-121"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fix shellcheck warnings and standardize error handling as requested in issue #121.
Changes
Shellcheck Warnings Fixed
local var=$(cmd)→local var; var=$(cmd))! bool && boolpattern with explicit[ "\$bool" = true ] && [ "\$bool2" = true ]Error Handling Standardization
set -euo pipefailfor consistent exit behaviorset -e(for critical operations)Retry Logic Added
Added configurable retry logic for network operations:
git clone retry (in
create_worktree):NETWORK_RETRY_ATTEMPTStimes (default: 3)NETWORK_RETRY_DELAY_SECONDS(default: 5s)opencode fork retry (in
create_session):NETWORK_RETRY_ATTEMPTStimesNew configuration variables:
Other Improvements
cdwithgit -Cfor safer directory handlingretry_with_backoffhelper function in kugetsu-config.shBackport Compatible
Yes - internal cleanup with stricter validation.
Acceptance Criteria
Closes #121
lgtm