File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -35,15 +35,22 @@ function __gitprofiles_hook() {
3535
3636 # Function to parse paths into an array and support tidle expansion
3737 function __parse_paths() {
38- local raw_paths=" ${(j: \n : )@ } " # join on newlines
39- local paths=(${(f)${(s: ,: )raw_paths} } ) # split on commas & newlines
38+ local raw_paths=" ${(j: \n : )@ } " # join args with newlines
39+ local temp=(${(s: ,: )raw_paths} ) # split on commas first
40+ # Now split each part by newlines
41+ local paths=()
42+ for part in $temp ; do
43+ paths+=(${(f)part} ) # split on newlines
44+ done
45+
46+ # Process each path
47+ paths=(${paths## [[:space:]]} ) # Trim leading spaces
48+ paths=(${paths%% [[:space:]]} ) # Trim trailing spaces
49+ paths=(${~paths} ) # Expand tilde
50+ paths=(${paths:# } ) # Remove empty elements
4051
41- paths=(${paths## [[:space:]]} ) # Trim leading spaces
42- paths=(${paths%% [[:space:]]} ) # Trim trailing spaces
43- paths=(${~paths} ) # Expand tilde
44- paths=(${paths:# } ) # Remove empty elements
4552 echo ${paths}
46- }
53+ }
4754
4855 # # Iterate over all profiles to get the name, email, signingkey and path
4956 for profile in ${profiles} ; do
You can’t perform that action at this time.
0 commit comments