Created
February 24, 2011 13:33
-
-
Save dbgrandi/842158 to your computer and use it in GitHub Desktop.
make hoptoad errors link directly to textmate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Hoptoad Textmate Backtrace | |
// @namespace hoptoad | |
// @description Add textmate links to application stacktrace lines on error pages | |
// @include https://YOURACCOUNT.hoptoadapp.com/errors/* | |
// ==/UserScript== | |
// | |
// based on original script from http://userscripts.org/scripts/show/63465 | |
// with much help from @orta | |
// | |
//update the path below to match the common parent directory of all your applications | |
var project_parent_directory ='/Users/YOURUSER/projects/YOUR_PROJECTS_ROOT/'; | |
// github links are nicely marked up in hoptoad | |
var github_links = jQuery("a.github-link")[0] | |
//pull the github project name from the github link | |
var project_name = jQuery(github_links).attr("href").split('/')[4]; | |
jQuery("a.github-link").each(function(index,item) { | |
i = item.text.split(':') | |
jQuery(item).attr("href", "txmt://open?url=file://" + project_parent_directory + project_name + "/" + i[0] + "&line=" + i[1]) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment