Permalink
Browse files

[fix] part2: occasionally on OSX the case insensitive filesystem conf…

…uses the file path calculation when attempting to locate the template file. This change includes a last ditch effort to recover.
  • Loading branch information...
Jim Carroll
Jim Carroll committed Nov 12, 2012
1 parent 4c6824d commit a09559ecc0dcb3bd576fe006d874be3e1b15560a
Showing with 6 additions and 1 deletion.
  1. +6 −1 tools/codegenerator/Helper.groovy
@@ -378,8 +378,13 @@ public class Helper
File parent = curTemplateFile.getParentFile()
// find the relative path to the convertTemplate
File cwd = new File('.').getCanonicalFile()
- String relative = cwd.toURI().relativize(convertTemplate.toURI()).getPath();
+ String relative = cwd.getAbsoluteFile().toURI().relativize(convertTemplate.getAbsoluteFile().toURI()).getPath()
convertTemplate = new File(parent,relative)
+
+ // This is a fallback case which is hit occationally on OSX as a result
+ // of case mismatches between the two paths in the relativize call above.
+ if (!convertTemplate.exists())
+ convertTemplate = new File(parent,cur.toString())
}
}

0 comments on commit a09559e

Please sign in to comment.