Binary builder & bash


#1

howdy,

I'm trying to use a bash script to launch binary builder to wrap up some files. I can't seem to get it to work. If I just open binarybuilder I get the explanation of how to use it -- so far so good. However when I try to open it with arguments (directory locations and file name) it just tells me I have a bad file name. 

this is probably just my nearly non-existant knowledge of bash! Can someone please give an example of how to open this with arguments? 

nick


#2

I haven't used binary builder in a while, and even then not as you're describing, so I may have the wrong end of the stick, but ... Are there any spaces in the file path you're supplying? If so, (on windows) you'll have to wrap the path in quotes or Linux place a "\" before spaces in the path

 


#3

nope, no spaces, but thanks for the suggestion. I did try wrapping them in quotes just to be sure, and didn't seem to help.

this is what I'm trying:

open binarybuilder  /myuserdirectory/code/myproject/somefiles /myuserdirectory/code/myproject/binarydata filename

the error I get is:

The files /myuserdirectory/code/JUCE/extras/binarybuilder/Builds/MacOSX/build/Debug/“myuserdirectory/code/myproject/binarydata/“  ... [and other long weird mushed together paths for other arguments] do not exist.

-n

PS -- i would just use introjucer for this, however it keeps messing with my Xcode project, so I want to avoid using it when I'm just adding a few files to binary data. 


#4

AFAIK, you don't need "open".

BinaryBuilder $HOME/Temp/Images $HOME/Temp/Binary Foo

Works fine for me (of course the binarybuilder executable must be in your $PATH).


#5

so you can easily step into the code with a debugger and figure out what is going wrong.


#6

a quick look through the BinaryBuilder source reveals that the error message you are showing here (unless you've not shown it accuately) is not coming from BinaryBuilder.


#7

thanks, but as I strongly suspect the problem is with my use/understanding of bash, I didn't think that would help :D


#8

aha, thanks. that gets rid of the errors on my paths (if I use $HOME to get to my home directory instead of trying to do give the full path). However I still get an error on the name I give (foo in your example) saying it does not exist. hmm.


#9

Did you try WITHOUT "open"?


#10

Probably the open command performed on all the following arguments.


#11

http://wiki.bash-hackers.org/doku.php

http://mywiki.wooledge.org/


#12

yes, if I get rid of open, I get "BinaryBuilder: command not found" 

 


#13

great links, thanks!


#14

thanks. hmm. so it is probably something i'm doing wrong with bash. still trying to figure that out though. 


#15

To launch a command without providing the fullpath, that command must be in the searchpath of your bash.

echo $PATH

If you don’t want to change the $PATH just provide the fullpath.

$HOME/Work/JUCE/extras/binarybuilder/Builds/MacOSX/build/Debug/BinaryBuilder

Of course the example above must be modify according to your JUCE directory.


#16

OK! Finaly managed to figure it out. Because I want to run binarybuilder from it's own directory, I need to use "./" to tell bash that the executable is in the directory I've navigated to. So the resulting script looks something like:

​#!/bin/bash

cd ~/Code/JUCE/extras/BinaryBuilder/Builds/MacOSX/build/Debug
 
./binarybuilder ~/Code/myproject/sourcefiles/ ~/Code/myproject/destination binaryname