-
Notifications
You must be signed in to change notification settings - Fork 23
Open in Trac Browser #19
Comments
You might try doing something with filesystem discovery. Basically, look at the current file's directory and keep going up a level until you find wp-config-sample.php and then from there go after the |
Thanks for the pointers. I've made some amends, done some painful rebasing (had to redo that SO many times and fix so many versions of the same conflict) and here's the combined commit… I think it's ready for you, if you're interested: I'm now using Spotlight to find the version.php file and then use regexes to find the WP version, and some simple search/replace logic to establish what the WordPress directory is. |
I love it! The only thing that I don't like is that it only works in the scope of a project. I think we should have a (slower) fallback that figures out where it is in relation to the wp-root and uses that in the mdfind command. |
So if you've opened a single file, the script recurses down the directories until it finds |
Yeah, I think that'd do it. |
One useful feature of WordPress' Trac instance is browsing a nice, syntax highlighted copy of the code. I find it handy to link to things during IRC and IM conversations, and in emails. I've written a command which opens the current file and line number in Trac. For example, here's a link to the
wp_update_post
function in Trac:http://core.trac.wordpress.org/browser/trunk//wp-includes/post.php#L2651
The commit for the command is here:
simonwheatley@4fd1b9c
Some questions, if you have a moment:
TM_PROJECT_DIRECTORY
is equivalent to WordPress' root dir – is there any way I can read the Path to WordPress preference into my command?Cheers,
Simon
The text was updated successfully, but these errors were encountered: