mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-05 01:46:46 +01:00
fix(fastfile): fix multiple bugs in plugin (#9574)
- `fastfile_sync` didn't correctly create the aliases - `fastfile_rm` didn't correctly remove the alias Fixes #9151 Closes #9574
This commit is contained in:
parent
0613232202
commit
79cf2a0d43
2 changed files with 15 additions and 13 deletions
|
|
@ -44,7 +44,7 @@ function fastfile() {
|
|||
# The path to the shortcut file
|
||||
#
|
||||
function fastfile_resolv() {
|
||||
echo "${fastfile_dir}${1}"
|
||||
echo "${fastfile_dir}/${1}"
|
||||
}
|
||||
|
||||
#
|
||||
|
|
@ -78,9 +78,9 @@ function fastfile_print() {
|
|||
# (=> fastfile_print) for each shortcut
|
||||
#
|
||||
function fastfile_ls() {
|
||||
for f in "${fastfile_dir}"/*(NF); do
|
||||
file=`basename "$f"` # To enable simpler handling of spaces in file names
|
||||
varkey=`echo "$file" | tr " " "_"`
|
||||
for f in "${fastfile_dir}"/*(N); do
|
||||
file=$(basename "$f") # To enable simpler handling of spaces in file names
|
||||
varkey=$(echo "$file" | tr " " "_")
|
||||
|
||||
# Special format for columns
|
||||
echo "${fastfile_var_prefix}${varkey}|->|$(fastfile_get "$file")"
|
||||
|
|
@ -98,15 +98,16 @@ function fastfile_ls() {
|
|||
function fastfile_rm() {
|
||||
fastfile_print "$1"
|
||||
rm "$(fastfile_resolv "$1")"
|
||||
unalias "${fastfile_var_prefix}${1}"
|
||||
}
|
||||
|
||||
#
|
||||
# Generate the aliases for the shortcuts
|
||||
#
|
||||
function fastfile_sync() {
|
||||
for f in "${fastfile_dir}"/*(NF); do
|
||||
file=`basename "$f"` # To enable simpler handling of spaces in file names
|
||||
varkey=`echo "$file" | tr " " "_"`
|
||||
for f in "${fastfile_dir}"/*(N); do
|
||||
file=$(basename "$f") # To enable simpler handling of spaces in file names
|
||||
varkey=$(echo "$file" | tr " " "_")
|
||||
|
||||
alias -g "${fastfile_var_prefix}${varkey}"="'$(fastfile_get "$file")'"
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue