Skip to content
Myr

Fixed view hints

Before adoption: this commit came in with the history the project adopted, so no landing records it.

populate attempts on new View

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 385a05d · Browse files · 2 files+7 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+7 added−5 removed

  • other:+7 added−5 removed

2 files+7 added−5 removed

modified:lib/view/view.js+1 added
47 unmodified lines
48 this.extension = '.' + this.engine;49 this.name = this.basename.replace(this.extension, '');50 this.path = this.resolvePath();51 this.dirname = dirname(this.path);52 options.attempts.push(this.path);53};5455/**56 * Check if the view path exists.
150 unmodified lines
modified:lib/view.js+6 added-5 removed
275 unmodified lines
276277 // status support278 if (options.status) this.statusCode = options.status;279280 // capture attempts281 options.attempts = [];282283 var partial = options.renderPartial284 , layout = options.layout;285286 // Layout support
118 unmodified lines
405406function hintAtViewPaths(view, options) {407 console.error();408 console.error('failed to locate view "' + view.view + '", tried:');406 console.error(' - ' + new View(view.path, options).path);407 console.error(' - ' + new View(view.prefixPath, options).path);408 console.error(' - ' + new View(view.indexPath, options).path);409 if (!options.isLayout) console.error(' - ' + new View(view.upIndexPath, options).path);410 if (options.isLayout) console.error(' - ' + new View(view.rootPath, options).path);409 options.attempts.forEach(function(path){410 console.error(' - %s', path);411 });412 console.error();413}