Roughly halved the amount of time to source bash completions

Former-commit-id: 624a99a5727e49b12c1468c27110cee893124fd2 [formerly f411a56d1f]
Former-commit-id: 48802e27abb02efaf80743bd4fc8dbe3a03219fa
This commit is contained in:
2022-09-08 09:47:59 -04:00
parent e5a4d80e3b
commit 9ab175a8d8
+2 -1
View File
@@ -5,7 +5,8 @@ _path_gen() {
local sshyp_path_length="$(("${#sshyp_path}" + 1))"
readarray -t full_paths < <(find "$sshyp_path" -type f -exec ls {} \;)
for path in "${full_paths[@]}"; do
trimmed_path=$(echo $path | sed 's/.\{4\}$//' | cut -c"$sshyp_path_length"-)
trimmed_path=${path%????}
trimmed_path=$(echo $trimmed_path | cut -c"$sshyp_path_length"-)
trimmed_path=$(echo ${trimmed_path// /\\ })
trimmed_paths+=("$trimmed_path")
done