Skip to content

Instantly share code, notes, and snippets.

@f213 f213/repack-mail-bundle.sh
Last active Mar 22, 2016

Embed
What would you like to do?
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, Maybe $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
You can’t perform that action at this time.