Versioned model doesn't work with only one version
sixten opened this issue · comments
Support was added in #102 and released in version 1.27 for passing a versioned model directory as the --model
argument to mogenerator. It appears to miss one edge case: it's possible for a newly-created versioned model (with exactly one model version inside of it) to lack a .xccurrentversion
file.
In Xcode 4.5.2, at least, new models are created in that state. And while the File Inspector does display a menu to select the current model version, selecting the one option available does not cause it to create the marker file.
I'd suggest perhaps that in the case where a versioned model is specified, and the current version file does not exist, that mogenerator count the number of *.xcdatamodel
items are in that directory. If there's exactly one, then the choice is pretty clear. If there are more (or zero), then execution should halt as it does now.
Thanks for the bug report. I like your solution, can I sweet-talk you into writing it?
Hah! Yeah, I'd be happy to take a stab at a patch, but I won't have time until the weekend at the earliest. Wanted to get the issue in before I lost the plot entirely.
On Nov 19, 2012, at 5:59 PM, rentzsch notifications@github.com wrote:
Thanks for the bug report. I like your solution, can I sweet-talk you into writing it?
—
Reply to this email directly or view it on GitHub.
Sweet. Even better! Thanks, @Sagran!
No problem. Actually ran into this, fixed it, and was surprised to find somebody else had run into this an hour before I did. :D
On Nov 19, 2012, at 20:25, Sixten Otto notifications@github.com wrote:
Sweet. Even better! Thanks, @Sagran!
—
Reply to this email directly or view it on GitHub.
Is there an official release with this code merged in?