pleonex / tinke

Viewer and editor for files of NDS games
GNU General Public License v3.0
356 stars 57 forks source link

compile.sh fails on paths with spaces in them. #47

Closed ghost closed 7 years ago

ghost commented 8 years ago

This one's a two-parter.

The first (and most easily fixable) part is that the script outputs the following error when checking for a previous build dir: ./compile.sh: line 38: [: /home/alicethegorgon/Projects/DS: binary operator expected

The solution is to change:

# Remove previous builds
if [ -d $BUILD_DIR ]; then
    echo "Deleting old build directory"
    rm -rf $BUILD_DIR
fi

into:

# Remove previous builds
if [ -d "$BUILD_DIR" ]; then
    echo "Deleting old build directory"
    rm -rf "$BUILD_DIR"
fi

(Note the quotation marks around both instances of $BUILD_DIR in the fixed one.)

The second problem is that xbuild errors out when compiling plugins, and gives the following error:

Compiling plugin Plugins/LAYTON/LAYTON.sln...
Error compiling Plugins/LAYTON/LAYTON.sln. Aborting.
MSBUILD: error MSBUILD0004: Too many project files specified

The solution seems to be getting rid of the line:

XBUILD_PLUGINS="$XBUILD;OutputPath=$BUILD_DIR/Plugins/"

And changing:

$XBUILD_PLUGINS "$1" > build.log

into:

$XBUILD "/p:OutputPath=$BUILD_DIR/Plugins/" "$1" > build.log

So that it follows the same format as the (working) compilation of tinke.

I have no idea why you can't just change the XBUILD_PLUGINS definition from:

XBUILD_PLUGINS="$XBUILD;OutputPath=$BUILD_DIR/Plugins/"

into:

XBUILD_PLUGINS="$XBUILD /p:OutputPath=$BUILD_DIR/Plugins/"

but for some reason it doesn't work, and gives the same "Too many project files" error.

Also, sorry for not submitting a pull request with these changes. I'm pretty new to git, and it's late, and I really don't want to delve into that whole process right now. I've attached the modified file though, so it should be easy to toss into the directory and compare and push the changes. (Github won't let me upload it as a ".sh" file, so I've zipped it up first.) compile.sh.zip

ccawley2011 commented 8 years ago

Added as part of pull request #46.