0

Currently when I attempt to use the Shell Script bundle in TextMate to execute an open shell script, it uses its own environment variables and does not source my user's ~/.bashrc file before execution.

Is it possible to configure TextMate to use my .bashrc file so that the execution environment is similar to that of a vanilla terminal window?

If I dig into the Shell Script bundle, I see that the Run Script command is executing this snippet of Ruby code. I presume if it is possible, this is where I would want to make a change:

#!/usr/bin/env ruby18

require ENV["TM_SUPPORT_PATH"] + "/lib/tm/executor"
require ENV["TM_SUPPORT_PATH"] + "/lib/tm/save_current_document"

TextMate.save_current_document
TextMate::Executor.make_project_master_current_document

TextMate::Executor.run(ENV["TM_SHELL"] || ENV["SHELL"] || "bash", ENV["TM_FILEPATH"])

1 Answer 1

0

You certainly can but it's not a configuration that is specific to TextMate. See this question https://stackoverflow.com/questions/1197224/source-shell-script-into-environment-within-a-ruby-script for more about adding your environment to a ruby script.

In bash, it would just be source ~/.bash_rc.

I'd suggest, however, that you would prefer to use the Variable Tab in TextMate's Settings to customize your TM Environment. Anything set there can be accessed same as the script in your question: ENV["foo"]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .