Sublime Forum

ST2 Build System Output

#1

I am new to using sublime text editor and I must say I fell in love with it right away, actually purchasing shortly after.

I wrote a simple build system that calls a simple bash script that copies a make file from a folder that I keep make files in into the directory that my sublime project resides in. The build system then calls the make file, which compiles the c files using avr-gcc and then calls avrdude and flashes a microcontroller.

This works well, however, I would like to see the output of each part of the build system. It seems that I can only see the output of the last part of the last “cmd” call. I only see the output of avrdude. When I run the bash script and the makefile in the terminal everything I want to see is printed out just fine. Here is my simple build system:

{
“cmd”: “checkForMake.sh”, “$file_path”],
“cmd”:“make”,“PROJECTNAME+=$file_base_name”,“install”]
}

Thank you for any help
Jesse

0 Likes

#2

Actually just realized this never worked, I think I must have been confused and thought that part of it was working when it really was not because I was testing parts of it outside of sublime to make sure it worked on the command line. I realize now you can only run one “cmd”. The other one only ran the makefile, which was the second command everytime.

What I have done now is:
{
“shell”:true,
“cmd”: “checkForMake.sh”, “$file_path”, “;” ,“make”,“PROJECTNAME+=$file_base_name”,“install”],
}

This does not work in sublime. It only runs the shell script and does not make it to running the makefile. It does, however, run in my terminal emulator as I intend it to.

Does anyone have any ideas? I am on Ubunut by the way and I am using ST2

0 Likes

#3

I found what my problem was. It was a combination of my bash script not handling spaces in my directory names and me not using the shell:true object corectly in the build system. So what works now is:

[code]{
“shell”:true,
“cmd”:“check.sh $file_path && make PROJECTNAME+=$file_base_name install”]

}[/code]

It seems that with the shell:true object I don’t need every input in the cmd list to be in quotes, just one long string.

Hope this helps some one else out

0 Likes