From 24283be05d8df6b8b9efea8c3ab81f12b2d18724 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Thu, 2 Mar 2017 18:35:13 +0100 Subject: [PATCH] Mute error message, when PlistBuddy is not installed PlistBuddy is part of XCode. It may be that users don't have it installed. --- neofetch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index f5162593..c8b23e26 100755 --- a/neofetch +++ b/neofetch @@ -1656,9 +1656,9 @@ get_term_font() { # https://www.iterm2.com/documentation-dynamic-profiles.html # Count Guids in "New Bookmarks"; they should be unique - local profilesCount=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:" ~/Library/Preferences/com.googlecode.iterm2.plist | grep "Guid" | wc -l) + local profilesCount=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:" ~/Library/Preferences/com.googlecode.iterm2.plist 2>/dev/null | grep "Guid" | wc -l) for idx in $(seq 0 ${profilesCount}); do - local profileName=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Name:" ~/Library/Preferences/com.googlecode.iterm2.plist) + local profileName=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Name:" ~/Library/Preferences/com.googlecode.iterm2.plist 2>/dev/null) if [[ "${profileName}" == "${currentProfileName}" ]]; then # "Normal Font" term_font=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Normal\ Font:" ~/Library/Preferences/com.googlecode.iterm2.plist)