Skip to content

Instantly share code, notes, and snippets.

@f213
Created September 15, 2015 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save f213/0d0c1500dba1ff5228f9 to your computer and use it in GitHub Desktop.
Save f213/0d0c1500dba1ff5228f9 to your computer and use it in GitHub Desktop.
Stupidly modify old Apple Mail plugins to fit you current system version
#!/bin/bash
#
# Copyright (c) 2015, Fedor Borshev, <f@f213.in>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
PlistBuddy="/usr/libexec/PlistBuddy"
if [ $# -eq 0 ];
then
echo Usage: $0 "bundle-dir"
exit 1
fi;
dir=$1
if [ ! -d $dir ];
then
echo Directory $dir not found
exit 1
fi;
plist="$dir/Contents/Info.plist"
if [ ! -f $plist ];
then
echo File $plist is not found, May by $dir is not a mailbundle?
exit 1
fi;
bundleVersion=`defaults read /Applications/Mail.app/Contents/Info PluginCompatibilityUUID`
$PlistBuddy -c "add :SupportedPluginCompatibilityUUIDs:0 string $bundleVersion" $plist
echo Your mail.app UDID $bundleVersion has beed added.
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment