mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Fixed: nib2cib did not allow xibs or images to be in subdirectories of Resources.
Previously, nib2cib would not correctly calculate the app/resource directories if the xib was in a subdirectory of Resources. Also, image resources in subdirectories did not have the subdirectory encoded with the image name. Now xibs and images may be anywhere under Resources. Fixes #1960.
This commit is contained in:
@@ -73,11 +73,11 @@ var FILE = require("file"),
|
||||
}
|
||||
|
||||
// Account for the fact that an extension may have been inferred.
|
||||
if (resourceInfo &&
|
||||
resourceInfo.path &&
|
||||
FILE.extension(resourceInfo.path) !== FILE.extension(_resourceName))
|
||||
if (resourceInfo && resourceInfo.path)
|
||||
{
|
||||
_resourceName += FILE.extension(resourceInfo.path);
|
||||
// Include subdirectories in the name
|
||||
match = /^.+\/Resources\/(.+)$/.exec(resourceInfo.path)
|
||||
_resourceName = match[1];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ var FILE = require("file"),
|
||||
resourceInfo ? FILE.canonical(resourceInfo.path) : "",
|
||||
size.width,
|
||||
size.height);
|
||||
}
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -554,12 +554,13 @@ var FILE = require("file"),
|
||||
{
|
||||
appDirectory = @"";
|
||||
|
||||
var parentDir = FILE.dirname(aPath);
|
||||
var parentDir = FILE.dirname(aPath),
|
||||
match = /^(.+)(\/Resources(?:\/.+)?)$/.exec(parentDir);
|
||||
|
||||
if (FILE.basename(parentDir) === "Resources")
|
||||
if (match)
|
||||
{
|
||||
appDirectory = FILE.dirname(parentDir);
|
||||
appResourceDirectory = parentDir;
|
||||
appDirectory = match[1];
|
||||
appResourceDirectory = FILE.join(appDirectory, "Resources");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user