Skip to content

Instantly share code, notes, and snippets.

@michaelfox
Created September 19, 2011 15:14
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 michaelfox/1226729 to your computer and use it in GitHub Desktop.
Save michaelfox/1226729 to your computer and use it in GitHub Desktop.
TextMate Update System Bundles (old)
#!/usr/bin/env php
<?php
$system_support_dir = '/Library/Application Support/TextMate';
$system_bundles_dir = $system_support_dir . "/Bundles";
$official_bundles = array(
"ActionScript" => "https://github.com/textmate/actionscript.tmbundle",
"Apache" => "https://github.com/textmate/apache.tmbundle",
"AppleScript" => "https://github.com/textmate/applescript.tmbundle",
"Blogging" => "https://github.com/textmate/blogging.tmbundle",
"Bundle Development" => "https://github.com/textmate/bundle-development.tmbundle",
"C" => "https://github.com/textmate/c.tmbundle",
"CSS" => "https://github.com/textmate/css.tmbundle",
"Diff" => "https://github.com/textmate/diff.tmbundle",
"HTML" => "https://github.com/textmate/html.tmbundle",
"Hyperlink-helper" => "https://github.com/textmate/hyperlink-helper.tmbundle",
"Java" => "https://github.com/textmate/java.tmbundle",
"JavaDoc" => "https://github.com/textmate/javadoc.tmbundle",
"JavaScript" => "https://github.com/textmate/javascript.tmbundle",
"LaTeX" => "https://github.com/textmate/latex.tmbundle",
"Mail" => "https://github.com/textmate/mail.tmbundle",
"Make" => "https://github.com/textmate/make.tmbundle",
"Markdown" => "https://github.com/textmate/markdown.tmbundle",
"Math" => "https://github.com/textmate/math.tmbundle",
"Objective-C" => "https://github.com/textmate/objective-c.tmbundle",
"OpenGL" => "https://github.com/textmate/opengl.tmbundle",
"PHP" => "https://github.com/textmate/php.tmbundle",
"Perl" => "https://github.com/textmate/perl.tmbundle",
"Property List" => "https://github.com/textmate/property-list.tmbundle",
"Python" => "https://github.com/textmate/python.tmbundle",
"Ruby on Rails" => "https://github.com/textmate/ruby-on-rails.tmbundle",
"Ruby" => "https://github.com/textmate/ruby.tmbundle",
"Sql" => "https://github.com/textmate/sql.tmbundle",
"Shell Script" => "https://github.com/textmate/shellscript.tmbundle",
"Source" => "https://github.com/textmate/source.tmbundle",
"Subversion" => "https://github.com/textmate/subversion.tmbundle",
"TODO" => "https://github.com/textmate/todo.tmbundle",
"Text" => "https://github.com/textmate/text.tmbundle",
"TextMate" => "https://github.com/textmate/textmate.tmbundle",
"Textile" => "https://github.com/textmate/textile.tmbundle",
"Transmit" => "https://github.com/textmate/transmit.tmbundle",
"XML" => "https://github.com/textmate/xml.tmbundle",
"Xcode" => "https://github.com/textmate/xcode.tmbundle",
"YAML" => "https://github.com/textmate/yaml.tmbundle",
);
if (!is_dir($system_bundles_dir)) {
`mkdir -p "{$system_bundles_dir}"`;
`sudo chown -R $(whoami) "{$system_support_dir}"`;
}
chdir($system_bundles_dir);
foreach ($official_bundles as $name => $url) {
$bundle_dir = "$name.tmbundle";
if (is_dir($bundle_dir)) {
$cmd = "cd \"{$bundle_dir}\" && git pull origin master && cd \"{$system_bundles_dir}\"";
} else {
$cmd = "git clone --recursive $url.git \"$bundle_dir\"";
}
echo `$cmd`;
}
echo `osascript -e 'tell app "TextMate" to reload bundles'`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment