Created
January 11, 2012 20:18
-
-
Save typeoneerror/1596565 to your computer and use it in GitHub Desktop.
Bash build system for running currently open script in Sublime Text 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cmd" : ["$file"], | |
"selector" : "source.shell", | |
"shell" : "bash" | |
} |
Hi All, I new on sublime. How to add that code into sublime?
Edit:
Okay, tools, build system, new build system.. and replace all content to andrewheiss's code. Thanks.
thanks
For some language (for example russian) whitespace symbols can be found in path:
/home/username/Рабочий стол/test.sh
and "cmd" : ["$file"],
not works correctly. I recommend add quotes and chmod for set permissions
"cmd" : ["chmod +x \"$file\" && \"$file\"" ],
If one wants to also have a "debug mode", a simple variant is
{
"cmd": ["bash", "$file"],
"selector": "source.shell",
"variants":
[
{
"name": "Debug",
"shell_cmd": "/bin/bash -xv \"${file}\""
}
]
}
note the escaped quotation marks to avoid issues with spaces etc. in the file name
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I also had to add the line as suggested above,
"path" : "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
Even though I already set up my symbolic links in terminal properly = Yes, I can run "python3" from any location...
To hammer it in farther... When I type
"echo $PATH"
it returns
"/Library/Frameworks/Python.framework/Versions/3.4/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/Hendrix/bin"
Yes, I am new at development. However, from logical deduction I ponder if sublime text 3 is not using ~/.bash_profile, or the system paths(??did I say that right?) as we might be drawn to assume... Then again... I am still at noob level, ,, but ya, adding the "path" line as suggested by 'farinspace' did the trick for me - OS X 10.9.5