From 0b255413d0557b6a90cf6448d13dcc95c5cb31a1 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Wed, 29 Jun 2022 10:08:01 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=8A=20Simplify=20grep=20string=20for?= =?UTF-8?q?=20POSIX=20compatibility?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bemoji | 2 +- test/bemoji.bats | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bemoji b/bemoji index 576c644..4619e30 100755 --- a/bemoji +++ b/bemoji @@ -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) diff --git a/test/bemoji.bats b/test/bemoji.bats index 6229b50..a7621a3 100644 --- a/test/bemoji.bats +++ b/test/bemoji.bats @@ -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>&-