mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
batch-compile: Fix mixing relative+absolute paths
This commit is contained in:
parent
057c767fbb
commit
80cb57cb88
1 changed files with 3 additions and 1 deletions
|
@ -124,9 +124,11 @@ class BlueprintApp:
|
|||
|
||||
for file in opts.inputs:
|
||||
data = file.read()
|
||||
file_abs = os.path.abspath(file.name)
|
||||
input_dir_abs = os.path.abspath(opts.input_dir)
|
||||
|
||||
try:
|
||||
if not os.path.commonpath([file.name, opts.input_dir]):
|
||||
if not os.path.commonpath([file_abs, input_dir_abs]):
|
||||
print(
|
||||
f"{Colors.RED}{Colors.BOLD}error: input file '{file.name}' is not in input directory '{opts.input_dir}'{Colors.CLEAR}"
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue