Skip to content

How to run tests when Sublime Text is NOT opened from the command line on OSX #194

@MattDMo

Description

@MattDMo

I just answered this question on StackOverflow about how to configure OSX Mountain Lion (not tested on earlier versions) to modify the internal PATH variable used by applications that are not opened from the command line, and I figured I'd share it with you so you could put it in the README, removing one limitation of your plugin :)


  1. Make sure you have admin privileges.

  2. Open Terminal or your favorite substitute and see if there's anything in the file /etc/launchd.conf:

    cat /etc/launchd.conf
    

    If you get an error like

    cat: /etc/launchd.conf: No such file or directory

    then continue with the next step. If the cat command does display some content, copy it to the clipboard.

  3. Create a new text file (⌘ N)with the following content, modified to fit your needs:

    setenv PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/Users/YourUserName/bin:/path/to/gems/bin
    

    If the cat command displayed some content in the previous step, paste it into the new file before the setenv PATH command. If it already contains a setenv PATH command, just modify it to add the directories you need, such as /path/to/gems/bin

  4. Save the new file in your home directory (/Users/YourUserName) as launchd.conf.

  5. Go back to Terminal and enter:

    sudo mv ~/launchd.conf /etc
    

    to use admin power to move the new file to /etc, replacing anything that was there before. You'll need to enter your password at this point.

  6. _Reboot your computer_

And you should be all set. This has only been tested on Mountain Lion (OSX 10.8), so you'll need to test it first if you're running an earlier version.


I hope this is helpful, it really was to me when I discovered it a few months back. If you need anything else, just let me know.

Matt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions