Skip to content

Commit 8867ec0

Browse files
committed
output
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 7dee855 commit 8867ec0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tools/schema-downloader.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
# Copyright (c) OWASP Foundation. All Rights Reserved.
1919

2020
import re
21-
from os.path import dirname, join
21+
from os.path import dirname, join, realpath
2222
from urllib.request import urlretrieve
2323

2424
SOURCE_ROOT = 'https://raw.githubusercontent.com/CycloneDX/specification/refs/tags/1.6.1/schema/'
25-
TARGET_ROOT = join(dirname(__file__), '..', 'cyclonedx', 'schema', '_res')
25+
TARGET_ROOT = realpath(join(dirname(__file__), '..', 'cyclonedx', 'schema', '_res'))
2626

2727
BOM_XSD = {
2828
'versions': ['1.6', '1.5', '1.4', '1.3', '1.2', '1.1', '1.0'],
@@ -101,8 +101,9 @@
101101
source = dspec['sourcePattern'].replace('%s', version)
102102
target = dspec['targetPattern'].replace('%s', version)
103103
tempfile, _ = urlretrieve(source) # nosec B310
104-
with open(tempfile, 'r') as tmpf:
105-
with open(target, 'w', newline='\n') as tarf:
104+
print(source, '->', target)
105+
with open(tempfile, 'r') as tmpf, \
106+
open(target, 'w', newline='\n') as tarf:
106107
text = tmpf.read()
107108
for search, replace in dspec['replace']:
108109
text = text.replace(search, replace)

0 commit comments

Comments
 (0)