I (and many others) use Mate with just typing
[term] mate /Dev/projectname
That gives you a TM window with the "project drawer". But this isn't really a project since we have no .tmproj file.
Anyway, two questions
#1 Is there a $TM_... path that can tell me the top-level directory for the open window?
Reason I'm asking is that some bundles, (just tried the AS3 one) depends on knowing the "root folder". They should just assume that we wanna use the currently opened dir (if one).
#2 Any alternative way of adding "tm shell variables" to a directory. Like the ones in project.tmproj -> shellVariables -> ..
best /david
On 28 May 2007, at 17:51, David Eriksson wrote:
But this isn't really a project since we have no .tmproj file.
Anyway, two questions
#1 Is there a $TM_... path that can tell me the top-level directory for the open window?
For a project yes, TM_PROJECT_DIRECTORY
Reason I'm asking is that some bundles, (just tried the AS3 one) depends on knowing the "root folder". They should just assume that we wanna use the currently opened dir (if one).
I don't use the bundle so can't comment on this.
#2 Any alternative way of adding "tm shell variables" to a directory. Like the ones in project.tmproj -> shellVariables -> ..
You can make a file called .textmate_init in the project root directory. This is a shell script which is executed before commands, so you should use e.g.
export TM_DB_USER=projectuser
However – due to an implementation detail these values won't be available for all commands so you might get some confusing results.
#1 Is there a $TM_... path that can tell me the top-level directory for the open window?
For a project yes, TM_PROJECT_DIRECTORY
I mean achieve the same result without using "projects".
The file list that shows up when launching mate from the terminal (mate projectdir) is obviously called "project drawer" even if we just opened a directory. Anyway, the list of files there, The top- directory, that is what I want.
best d
On 28. May 2007, at 19:33, David Eriksson wrote:
#1 Is there a $TM_... path that can tell me the top-level directory for the open window?
For a project yes, TM_PROJECT_DIRECTORY
I mean achieve the same result without using "projects".
The TM_PROJECT_DIRECTORY will be set to the root folder in the project drawer.
If there are multiple entries at root level, it will be the nearest common ancestor of these, so e.g. adding a bunch of files from the same folder will have that folder as project directory.
As for the .textmate_init file Ciarán mentioned, it works for all but commands which use shebang.