Skip to content

Commit

Permalink
Added missing document template validation (forgot about it before).
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaz committed Feb 20, 2011
1 parent 2095a76 commit 1e1ad04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions Common/NSError+GBError.h
Expand Up @@ -28,6 +28,7 @@ enum {
GBErrorTemplatePathNotDirectory,

GBErrorHTMLObjectTemplateMissing = 8000,
GBErrorHTMLDocumentTemplateMissing,
GBErrorHTMLIndexTemplateMissing,
GBErrorHTMLHierarchyTemplateMissing,

Expand Down
7 changes: 7 additions & 0 deletions Generating/GBHTMLOutputGenerator.m
Expand Up @@ -171,6 +171,13 @@ - (BOOL)validateTemplates:(NSError **)error {
}
return NO;
}
if (!self.htmlDocumentTemplate) {
if (error) {
NSString *desc = [NSString stringWithFormat:@"Document template file 'document-template.html' is missing at '%@'!", self.templateUserPath];
*error = [NSError errorWithCode:GBErrorHTMLDocumentTemplateMissing description:desc reason:nil];
}
return NO;
}
if (!self.htmlIndexTemplate) {
if (error) {
NSString *desc = [NSString stringWithFormat:@"Index template file 'index-template.html' is missing at '%@'!", self.templateUserPath];
Expand Down

0 comments on commit 1e1ad04

Please sign in to comment.