From 1b5e9c1284ede59d771bfd43780cc8f6f7446f38 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 6 Feb 2025 16:55:45 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=8A=20Ensure=20function=20variables=20?= =?UTF-8?q?are=20declared=20local?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bemoji | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bemoji b/bemoji index 481af8f..7a648e1 100755 --- a/bemoji +++ b/bemoji @@ -180,6 +180,7 @@ dl_nerd_symbols() { } gather_emojis() { + local result if [ -n "$BEMOJI_CUSTOM_LIST" ] && [ -f "$BEMOJI_CUSTOM_LIST" ]; then result=$(cat "$BEMOJI_CUSTOM_LIST") elif [ -n "$BEMOJI_CUSTOM_LIST" ] && curl -fsSI "$BEMOJI_CUSTOM_LIST" >/dev/null 2>&1; then @@ -197,12 +198,12 @@ gather_emojis() { } get_most_recent() { - limit=${1} - recent_file="$bm_history_file" + local limit=${1} + local recent_file="$bm_history_file" if [ ! -f "$recent_file" ]; then touch "$recent_file" fi - # TODO improve this messy line + # TODO: improve this messy line local result result=$(sed -e '/^$/d' "$recent_file" | sort | @@ -244,6 +245,7 @@ _clipper() { # Set default typing util _typer() { + local totype totype=$(cat -) if [ -n "$BEMOJI_TYPE_CMD" ]; then