Commit 24283be0 authored by Dominik Ritter's avatar Dominik Ritter

Mute error message, when PlistBuddy is not installed

PlistBuddy is part of XCode. It may be that users don't have it installed.
parent 38641c69
...@@ -1656,9 +1656,9 @@ get_term_font() { ...@@ -1656,9 +1656,9 @@ get_term_font() {
# https://www.iterm2.com/documentation-dynamic-profiles.html # https://www.iterm2.com/documentation-dynamic-profiles.html
# Count Guids in "New Bookmarks"; they should be unique # 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 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 if [[ "${profileName}" == "${currentProfileName}" ]]; then
# "Normal Font" # "Normal Font"
term_font=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Normal\ Font:" ~/Library/Preferences/com.googlecode.iterm2.plist) term_font=$(/usr/libexec/PlistBuddy -c "Print :New\ Bookmarks:${idx}:Normal\ Font:" ~/Library/Preferences/com.googlecode.iterm2.plist)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment