Update default path for config files
This commit is contained in:
@@ -170,12 +170,14 @@ def generate_basic_config(
|
||||
|
||||
# Create output directory if it doesn't exist
|
||||
schema_path = Path(schema_output)
|
||||
schema_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
if schema_path.parent != Path("."):
|
||||
schema_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
print(f"Created config directory: {schema_path.parent}")
|
||||
|
||||
with open(schema_output, "w") as f:
|
||||
yaml.dump(config, f, sort_keys=False)
|
||||
|
||||
print(f"Data schema config saved to: {schema_output}")
|
||||
print(f"Data schema config saved to: {schema_path.absolute()}")
|
||||
|
||||
# Generate separate instrument settings config from INI file
|
||||
if ini_file:
|
||||
@@ -272,12 +274,16 @@ def generate_mapping_config(
|
||||
|
||||
# Create output directory if it doesn't exist
|
||||
schema_path = Path(schema_output)
|
||||
schema_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
if schema_path.parent != Path("."):
|
||||
schema_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
print(f"Created config directory: {schema_path.parent}")
|
||||
|
||||
with open(schema_output, "w") as f:
|
||||
yaml.dump(config, f, sort_keys=False, default_flow_style=False)
|
||||
|
||||
print(f"Enhanced data schema config with column mapping saved to: {schema_output}")
|
||||
print(
|
||||
f"Enhanced data schema config with column mapping saved to: {schema_path.absolute()}"
|
||||
)
|
||||
|
||||
# Generate separate instrument settings config from INI file
|
||||
if ini_file:
|
||||
@@ -340,8 +346,8 @@ Examples:
|
||||
parser.add_argument(
|
||||
"--schema-output",
|
||||
"-s",
|
||||
default="config_schema.yaml",
|
||||
help="Output filename for data schema config (default: config_schema.yaml)",
|
||||
default="config/config_schema.yaml",
|
||||
help="Output filename for data schema config (default: config/config_schema.yaml)",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
@@ -425,8 +431,8 @@ def main():
|
||||
# Generate configuration
|
||||
if args.mapping:
|
||||
schema_file = (
|
||||
"config_schema_with_mapping.yaml"
|
||||
if args.schema_output == "config_schema.yaml"
|
||||
"config/config_schema_with_mapping.yaml"
|
||||
if args.schema_output == "config/config_schema.yaml"
|
||||
else args.schema_output
|
||||
)
|
||||
generate_mapping_config(
|
||||
|
||||
Reference in New Issue
Block a user