Skip to content

Commit

Permalink
[fix] part2: occasionally on OSX the case insensitive filesystem conf…
Browse files Browse the repository at this point in the history
…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 committed Nov 12, 2012
1 parent 4c6824d commit a09559e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tools/codegenerator/Helper.groovy
Expand Up @@ -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())
}
}

Expand Down

0 comments on commit a09559e

Please sign in to comment.