🦊 Simplify grep string for POSIX compatibility

This commit is contained in:
Marty Oehme 2022-06-29 10:08:01 +02:00
parent 75395d2bbd
commit 0b255413d0
Signed by: Marty
GPG key ID: B7538B8F50A1C800
2 changed files with 2 additions and 1 deletions

2
bemoji
View file

@ -199,7 +199,7 @@ _clipResult() {
result=$(gather_emojis | _picker)
exit_value="$?"
[ "$bm_private_mode" = true ] || add_to_recent "$result"
result=$(echo "$result" | grep -oP '^[^\s]+' | tr -d '\n')
result=$(echo "$result" | grep -o '^\S\+' | tr -d '\n')
case "$exit_value" in
1)

View file

@ -18,6 +18,7 @@ setup() {
}
@test "test can run script" {
export BEMOJI_CLIP_CMD="echo clip test only"
# closing FD3 manually to prevent hangs, see
# https://bats-core.readthedocs.io/en/stable/writing-tests.html#file-descriptor-3-read-this-if-bats-hangs
run bemoji 3>&-