Skip to content

Commit 4b36596

Browse files
Baptiste PrevotCastavo
Baptiste Prevot
authored andcommitted
railjson-generator: fix example script generation dir
1 parent e7e09e6 commit 4b36596

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python/railjson_generator/railjson_generator/scripts/examples/example_script.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
from pathlib import Path
44

5-
from railjson_generator import InfraBuilder, Location, SimulationBuilder
5+
from railjson_generator import InfraBuilder, Location, SimulationBuilder, get_output_dir
66
from railjson_generator.schema.infra.direction import Direction
77

8-
CURRENT_DIR = Path(__file__).parent
8+
OUTPUT_DIR = get_output_dir()
99

1010
# GENERATE INFRA
1111
builder = InfraBuilder()
@@ -60,7 +60,7 @@
6060
infra = builder.build()
6161

6262
# Save railjson
63-
infra.save(CURRENT_DIR / Path("infra.json"))
63+
infra.save(OUTPUT_DIR / Path("infra.json"))
6464

6565
# GENERATE SIMULATION
6666
builder = SimulationBuilder()
@@ -86,4 +86,4 @@
8686
sim = builder.build()
8787

8888
# Save railjson
89-
sim.save(CURRENT_DIR / Path("simulation.json"))
89+
sim.save(OUTPUT_DIR / Path("simulation.json"))

0 commit comments

Comments
 (0)