mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-07 17:38:02 +00:00
Fix for capp gen sometimes failing.
Reviewed by me.
This commit is contained in:
1 parent
47de360719
commit
13c5736a0f
1 file changed
+18
-8
+18
-8
@@ -92,18 +92,28 @@ function gen(/*va_args*/)
|
||||
if (FILE.isDirectory(path))
|
||||
continue;
|
||||
|
||||
// Don't do this for images.
|
||||
if ([".png", ".jpg", ".jpeg", ".gif", ".tif", ".tiff"].indexOf(FILE.extension(path)) !== -1)
|
||||
if (FILE.basename(path) === ".DS_Store")
|
||||
continue;
|
||||
|
||||
var contents = FILE.read(path, { charset : "UTF-8" }),
|
||||
key = nil,
|
||||
keyEnumerator = [configuration keyEnumerator];
|
||||
// Don't do this for images.
|
||||
if ([".png", ".jpg", ".jpeg", ".gif", ".tif", ".tiff"].indexOf(FILE.extension(path).toLowerCase()) !== -1)
|
||||
continue;
|
||||
|
||||
while (key = [keyEnumerator nextObject])
|
||||
contents = contents.replace(new RegExp("__" + RegExp.escape(key) + "__", 'g'), [configuration valueForKey:key]);
|
||||
try
|
||||
{
|
||||
var contents = FILE.read(path, { charset : "UTF-8" }),
|
||||
key = nil,
|
||||
keyEnumerator = [configuration keyEnumerator];
|
||||
|
||||
FILE.write(path, contents, { charset: "UTF-8"});
|
||||
while (key = [keyEnumerator nextObject])
|
||||
contents = contents.replace(new RegExp("__" + RegExp.escape(key) + "__", 'g'), [configuration valueForKey:key]);
|
||||
|
||||
FILE.write(path, contents, { charset: "UTF-8"});
|
||||
}
|
||||
catch (anException)
|
||||
{
|
||||
print("Copying and modifying " + path + " failed.");
|
||||
}
|
||||
}
|
||||
|
||||
var frameworkDestination = destinationProject;
|
||||
|
||||
Reference in new issue
Block a user