mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-08-28 04:46:34 -04:00
Made Bash completions significantly faster, temporarily ensure recursive globbing is enabled
Former-commit-id: c974ce1e0cb0198094d6ece325ab3216f1925f36 Former-commit-id: 762562fbbdb298f4b13210d0014a942b430c1197
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
|
||||
_path_gen() {
|
||||
local sshyp_path="$HOME/.local/share/sshyp"
|
||||
local sshyp_path_length="$(("${#sshyp_path}" + 1))"
|
||||
full_paths=(~/.local/share/sshyp/**/*.gpg)
|
||||
local glob_status=$(shopt -p globstar)
|
||||
[ -z "${glob_status##*u*}" ] && shopt -s globstar # if recursive globbing is disabled, enable it
|
||||
full_paths=("$sshyp_path"/**/*.gpg)
|
||||
$glob_status # set recursive globbing to user default
|
||||
for path in "${full_paths[@]}"; do
|
||||
trimmed_path=$(echo ${path%????} | cut -c"$sshyp_path_length"-)
|
||||
trimmed_paths+=("$trimmed_path")
|
||||
trimmed_paths+=("${path:${#sshyp_path}:-4}")
|
||||
done
|
||||
} &&
|
||||
|
||||
|
||||
Reference in New Issue
Block a user