objc-run icon indicating copy to clipboard operation
objc-run copied to clipboard

bugfix. correctly handles filenames with spaces

Open algal opened this issue 10 years ago • 7 comments

Previously, if a file had a space in its filename and used cocoapods, then objc-run would fail to build it correctly, as a result of trying to copy to the unescaped filename, so that it copied only to the first token of the filename.

This commit fixes that by wrapping the filename in quotes.

algal avatar Mar 19 '14 17:03 algal

Does the test script still work with your changes? Travis says it's broken.

iljaiwas avatar Mar 19 '14 18:03 iljaiwas

I've added further bug fixes (which are also just adding missing quotes around paths), and added a new test case to the ./test.bash script that exposes the issue. You can see the test case fails if you try to run it without the other changes to objc-run. The test script works for me, after purging the objc-run temporary directory.

algal avatar Mar 20 '14 19:03 algal

I am not sure of it, but I would guess Travis is failing because old files are persisting in the temporary directory between test runs, and corrupting the test.

algal avatar Mar 20 '14 19:03 algal

Test script is failing for me locally, too. What version of Xcode are you running? I'm still holding out with 5.0.x.

iljaiwas avatar Mar 21 '14 10:03 iljaiwas

very odd. I'm on 5.1. Did you clear the temporary outputs in /var/folders/stuff/objc-run before running?

algal avatar Mar 21 '14 16:03 algal

The Travis error is that it cannot find the temporary directory. So it seems the deeper problem here is the temporary directory needing to be manually cleared between upgrades of this script. Seems like that's an issue of its own.

I suspect you've forgotten more about bash scripting than I've ever learned, so I may not be the right one to fix this but I'll have a look

algal avatar Mar 22 '14 05:03 algal

Okay, I updated the script so it won't re-use temporary project assets that were created with earlier versions of the script.

However, that doesn't resolve the travis build errors, which I believe are due to the travis build environment using an older versions of Xcode, ruby, and cocoa pods. When travis updates its stuff, or if/when I figure out how to configure it to use more modern build environment, then I'll be a in a position to debug this further, but for now I'm throwing in the towel.

FWIW, my commit 41cbe31 works for me with: Apple's Xcode 5.1, Apple's system ruby v2.0.0p247, and cocoa pods v0.29.0.

algal avatar Mar 23 '14 18:03 algal