View Full Version : [Bug Report] app-build.js

Rémy Esmery
18 Dec 2012, 2:17 PM

I've recently faced some issue that would cause my build to fail with an IOException "bad pathname" exception.
After some investigation, it turned out that the problem was lying in the stripSpecialDirNames function of the app-build.js script.
This function misuses the replace method, expecting it to treat the whole input string, whereas it only replaces the first occurence of the provided pattern.
This would cause a relative input path containing more than once the same "special dir name" to be stripped as an invalid path name. In my case :
../../../Library was stripped to

This is reproducible with version

A fix to this could be replacing the stripSpecialDirNames implementation with the following code :

return path
.replace(/\.\.\//g, "")
.replace(/\.\.\\/g, "")
.replace(/\.\//g, "")
.replace(/\.\\/g, "")
.replace(/~\//g, "");

Best regards,

Rémy ESMERY, CEO at Flynware