mirror of
https://git.dn42.dev/dn42/registry.git
synced 2025-07-09 04:05:25 +08:00
fix path
This commit is contained in:
parent
b5b80ff14d
commit
9702c6cba8
1 changed files with 3 additions and 3 deletions
|
@ -70,7 +70,7 @@ def run(args: List[str], env: Dict[str, str]) -> int:
|
||||||
for schema in schema_set.schemas:
|
for schema in schema_set.schemas:
|
||||||
schemas[schema.ref] = schema
|
schemas[schema.ref] = schema
|
||||||
|
|
||||||
def file_gen():
|
def file_gen(path):
|
||||||
if opts.scan_dir is not None:
|
if opts.scan_dir is not None:
|
||||||
path = os.path.join(env.get("WORKING_DIR"), opts.scan_dir)
|
path = os.path.join(env.get("WORKING_DIR"), opts.scan_dir)
|
||||||
elif opts.scan_file is not None:
|
elif opts.scan_file is not None:
|
||||||
|
@ -81,11 +81,11 @@ def run(args: List[str], env: Dict[str, str]) -> int:
|
||||||
|
|
||||||
if opts.add_index:
|
if opts.add_index:
|
||||||
print("Add scanned items to lookup index...", file=sys.stderr)
|
print("Add scanned items to lookup index...", file=sys.stderr)
|
||||||
for dom in file_gen():
|
for dom in file_gen(path):
|
||||||
key, value = dom.index
|
key, value = dom.index
|
||||||
lookups[key] = value
|
lookups[key] = value
|
||||||
|
|
||||||
for dom in file_gen():
|
for dom in file_gen(path):
|
||||||
s = schemas.get(dom.rel)
|
s = schemas.get(dom.rel)
|
||||||
if s is None:
|
if s is None:
|
||||||
print(f"{dom.src} schema not found for {dom.rel}")
|
print(f"{dom.src} schema not found for {dom.rel}")
|
||||||
|
|
Loading…
Add table
Reference in a new issue