Sublime Forum

Launch terminal and run shell script from sublime build system

#1

I would like my build system to be able to have a variant that launches a terminal win and runs a shell script from that window.

I am running on linux. Basically I just want to be able to compile my command line app, and then launch it.

I have the following build system in sublime…

{
“cmd”: [“gradle” , “build”],
“working_dir”: “${project_path}”,
“file_regex”: “^:compileJava(…?):([0-9]):?([0-9]*)”,

"variants": [
    { 
        "name": "Run",
        "working_dir": "${project_path}",
        "cmd": ["./run.sh"]
    }
]

}

Two problems. One is immediate, and one is anticipated.

The first problem is that it simply does not find the shell script, even though I am certain it exists in the working_dir…

[Errno 8] Exec format error
[cmd: [’./run.sh’]]
[dir: /home/user/src/Java/DrumSequencer]
[path: /home/scott/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games]
[Finished]

The second concern is that if it does find the shell script, that it will run in the sublime console, and not in a new terminal.

Is anyone able to provide some guidance on achieving my goal?

Thanks!

0 Likes