I've got the absolute path available in commands via $TM_FILEPATH. How can I write a command that gives me a relative path, specifically i'd like to copy this path to enable sharing and ease some git/bash operations?
In TextMate (or Sublime) how can I get the path relative my project directory?
221 views Asked by Graham P Heath At
1
pbcopywill place a string onto your clipboard. From there, you just need to do some detect and replacement.Start with the standard bash Command TextMate boilerplate:
Then check if the $TM_PROJECT_DIRECTORY exists:
If not, copy the full path:
If so replace the project path in the file path, and copy;
Please see this gist incase of updates.