parser: fix (absolute path) error (#12747)

pull/12756/head
yuyi 2021-12-07 17:33:53 +08:00 committed by GitHub
parent f60cf65284
commit c29a3cf6e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -161,7 +161,11 @@ fn (mut p Parser) comptime_call() ast.ComptimeCall {
path += '.html'
path = os.real_path(path)
if !is_html {
path = os.join_path_single(dir, tmpl_path)
if os.is_abs_path(tmpl_path) {
path = tmpl_path
} else {
path = os.join_path_single(dir, tmpl_path)
}
}
if !os.exists(path) {
if is_html {