Skip to content

Instantly share code, notes, and snippets.

@typeoneerror
Created January 11, 2012 20:18
Show Gist options
  • Star 21 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save typeoneerror/1596565 to your computer and use it in GitHub Desktop.
Save typeoneerror/1596565 to your computer and use it in GitHub Desktop.
Bash build system for running currently open script in Sublime Text 2
{
"cmd" : ["$file"],
"selector" : "source.shell",
"shell" : "bash"
}
@pudovmaxim
Copy link

pudovmaxim commented Oct 5, 2016

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\"" ],

@JosjaVanBever
Copy link

JosjaVanBever commented Dec 1, 2018

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