diff options
author | Jim Carroll <thecarrolls@jiminger.com> | 2012-11-12 18:03:27 -0500 |
---|---|---|
committer | Jim Carroll <thecarrolls@jiminger.com> | 2012-11-12 18:03:27 -0500 |
commit | a09559ecc0dcb3bd576fe006d874be3e1b15560a (patch) | |
tree | aa6b67c67f0a0d6f8968e951cd1218b726de5c0e /tools/codegenerator | |
parent | 4c6824dfe87d910819e7faa2ad9cacb07aaedb0e (diff) |
[fix] part2: occasionally on OSX the case insensitive filesystem confuses the file path calculation when attempting to locate the template file. This change includes a last ditch effort to recover.
Diffstat (limited to 'tools/codegenerator')
-rw-r--r-- | tools/codegenerator/Helper.groovy | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/codegenerator/Helper.groovy b/tools/codegenerator/Helper.groovy index 65102143bb..ecae893128 100644 --- a/tools/codegenerator/Helper.groovy +++ b/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()) } } |