First off I would like to say that I am new to sublime text editor and I love it. I have no experience with JSON, however it does not seem difficult at all.
I am trying to write a build system that will call a bash script that will move a makefile into the directory that I am working and call that makefile, which will compile my c code with avr-gcc and then flash it to a connected microcontroller using avrdude.
I realize that sublime text 2 can only have one "cmd" object so I tried calling everything on one line from a terminal emulator and it worked exactly how I intended it to. The call was:
checkAVRmakefile.sh $PWD; make PROJECTNAME+=hello install
my script is in a directory on my $PATH environment variable and I pass it the directory that I am working in so it checks there for the makefile and if it isn't there it copies it from the directory that I have where I keep all of my makefiles. Then I call make and pass it the name I with the project to be called and the install flashes the avr microcontroller.
What I do with sublime is this:
{
"shell":true,
"cmd":[ "checkAVRmakefile.sh", "$file_path", ";" ,"make","PROJECTNAME+=$file_base_name","install"],
}
This only runs the bash script which puts the makefile in the directory but does not run make.
Does anyone see where I went wrong?
Any help is appreciated. I also asked a question similar to this on the sublime forums but no one has answered. Also I am on Ubuntu and am using ST2.
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:
{
"shell":true,
"cmd":["check.sh $file_path && make PROJECTNAME+=$file_base_name install"]
}
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.
(thanks to u/Scoo_ from reddit for suggesting the fix) Hope this helps some one else out
EDIT (17-3-2014): I have uploaded the files that I use for building my AVR projects to my git hub: https://github.com/Jesse-Millwood/AVR-Stuffs.git