From 4eef4d6a2daea5ae8ab7ddd18b411ef151196d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 24 Mar 2023 07:40:32 +0100 Subject: pkgs/shellrc-user-setup: fix the grep that checks for existing content --- pkgs.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs.nix b/pkgs.nix index ab36908..81104e7 100644 --- a/pkgs.nix +++ b/pkgs.nix @@ -40,11 +40,11 @@ cmdbash='eval $(shellrc-bash)' cmdzsh='eval $(shellrc-zsh)' if command -v shellrc-bash 2>/dev/null >&2 \ - && ! grep -xf "$cmdbash" ~/.bashrc; then + && ! grep -qxF "$cmdbash" ~/.bashrc 2>/dev/null; then echo "$cmdbash" >>~/.bashrc fi if command -v shellrc-zsh 2>/dev/null >&2 \ - && ! grep -xf "$cmdzsh" ~/.zshrc; then + && ! grep -qxF "$cmdzsh" ~/.zshrc 2>/dev/null; then echo "$cmdzsh" >>~/.zshrc fi ''; -- cgit v1.2.3