mirror of
https://github.com/Telecominfraproject/ols-ucentral-schema.git
synced 2025-10-30 01:32:26 +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;
|
||||
}
|
||||
|
||||
let parent_path = null;
|
||||
|
||||
// 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, /\/[^\/]+$/, '');
|
||||
}
|
||||
let parent_path = sourcepath(1, true);
|
||||
|
||||
assert(parent_path, "Unable to determine calling template path");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user