mirror of
https://github.com/Telecominfraproject/ols-ucentral-schema.git
synced 2025-11-02 02:57:55 +00:00
renderer: replace die/catch hack with sourcepath() to obtain template path
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
committed by
John Crispin
parent
05bc3f0532
commit
4973d24bdc
@@ -40,14 +40,7 @@ function tryinclude(path, scope) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let parent_path = null;
|
let parent_path = sourcepath(1, true);
|
||||||
|
|
||||||
// XXX: This is a somewhat convoluted way to obtain the filename of the
|
|
||||||
// calling template we're including the file for. Might eventually
|
|
||||||
// replace it with something cleaner.
|
|
||||||
try { die(); } catch(e) {
|
|
||||||
parent_path = replace(e.stacktrace[1].filename, /\/[^\/]+$/, '');
|
|
||||||
}
|
|
||||||
|
|
||||||
assert(parent_path, "Unable to determine calling template path");
|
assert(parent_path, "Unable to determine calling template path");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user