Merge pull request #1738 from NoahGorny/fix-1354

Use command rm in alias_completion
pull/1757/head
Noah Gorny 2020-12-27 19:11:11 +02:00 committed by GitHub
commit 908fed9f50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -91,5 +91,5 @@ function alias_completion {
echo "$new_completion" >> "$tmp_file"
fi
done < <(alias -p | sed -Ene "s/$alias_regex/\2 '\3' '\4'/p")
source "$tmp_file" && rm -f "$tmp_file"
source "$tmp_file" && command rm -f "$tmp_file"
}; alias_completion

View File

@ -7,7 +7,7 @@ load ../../lib/helpers
cite _about _param _example _group _author _version
load ../../completion/available/git.completion
load ../../completion/available/capistrano.completion
@test "alias-completion: See that aliases with double quotes and brackets do not break the plugin" {
alias gtest="git log --graph --pretty=format:'%C(bold)%h%Creset%C(magenta)%d%Creset %s %C(yellow)<%an> %C(cyan)(%cr)%Creset' --abbrev-commit --date=relative"
@ -22,3 +22,10 @@ load ../../completion/available/git.completion
assert_success
}
@test "alias-completion: See that having aliased rm command does not output unnecessary output" {
alias rm='rm -v'
load ../../plugins/available/alias-completion.plugin
refute_output
}