From 595b5b0aaacf8a2d98eaabb3e7f615639fe10cb4 Mon Sep 17 00:00:00 2001 From: Jean SIMARD Date: Wed, 31 Mar 2021 09:27:09 +0200 Subject: [PATCH 1/2] [feature] automatically create output folders when not existing --- src/gtfs/mod.rs | 1 + src/netex_france/exporter.rs | 1 + src/ntfs/mod.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/src/gtfs/mod.rs b/src/gtfs/mod.rs index 5027f4024..432cdd9c9 100644 --- a/src/gtfs/mod.rs +++ b/src/gtfs/mod.rs @@ -452,6 +452,7 @@ pub fn write>(model: Model, path: P) -> Result<()> { let collections = remove_stop_zones(model); let model = Model::new(collections)?; let path = path.as_ref(); + std::fs::create_dir_all(path)?; info!("Writing GTFS to {:?}", path); write::write_transfers(path, &model.transfers)?; diff --git a/src/netex_france/exporter.rs b/src/netex_france/exporter.rs index bcc81cfdd..86a22ce14 100644 --- a/src/netex_france/exporter.rs +++ b/src/netex_france/exporter.rs @@ -153,6 +153,7 @@ impl<'a> Exporter<'a> { where P: AsRef, { + std::fs::create_dir_all(&path)?; self.write_lines(&path)?; self.write_stops(&path)?; self.write_calendars(&path)?; diff --git a/src/ntfs/mod.rs b/src/ntfs/mod.rs index 66fa79ce0..e051fa150 100644 --- a/src/ntfs/mod.rs +++ b/src/ntfs/mod.rs @@ -232,6 +232,7 @@ pub fn write>( current_datetime: DateTime, ) -> Result<()> { let path = path.as_ref(); + std::fs::create_dir_all(path)?; info!("Writing NTFS to {:?}", path); write::write_feed_infos(path, &model, current_datetime)?; From 157870514176ba8913a6fd6bcfb505c35ded1902 Mon Sep 17 00:00:00 2001 From: Jean SIMARD Date: Wed, 31 Mar 2021 10:48:30 +0200 Subject: [PATCH 2/2] [feature] bump to 0.35 --- Cargo.toml | 2 +- gtfs2netexfr/Cargo.toml | 2 +- gtfs2ntfs/Cargo.toml | 2 +- ntfs2gtfs/Cargo.toml | 2 +- ntfs2netexfr/Cargo.toml | 2 +- ntfs2ntfs/Cargo.toml | 2 +- restrict-validity-period/Cargo.toml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b5ede84d1..e03a04829 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] authors = ["Kisio Digital ", "Guillaume Pinot "] name = "transit_model" -version = "0.34.1" +version = "0.35.0" license = "AGPL-3.0-only" description = "Transit data management" repository = "https://github.com/CanalTP/transit_model" diff --git a/gtfs2netexfr/Cargo.toml b/gtfs2netexfr/Cargo.toml index 1e0e457a0..b56de0c57 100644 --- a/gtfs2netexfr/Cargo.toml +++ b/gtfs2netexfr/Cargo.toml @@ -22,5 +22,5 @@ slog-scope = "4.1" slog-stdlog = "4.0" slog-term = "2.4" structopt = "0.3" -transit_model = { version = "0.34", path = "../", features = ["proj"] } +transit_model = { version = "0.35", path = "../", features = ["proj"] } lazy_static = "1" diff --git a/gtfs2ntfs/Cargo.toml b/gtfs2ntfs/Cargo.toml index 674052f30..a8538e9dc 100644 --- a/gtfs2ntfs/Cargo.toml +++ b/gtfs2ntfs/Cargo.toml @@ -22,5 +22,5 @@ slog-scope = "4.1" slog-stdlog = "4.0" slog-term = "2.4" structopt = "0.3" -transit_model = { version = "0.34", path = "../" } +transit_model = { version = "0.35", path = "../" } lazy_static = "1" diff --git a/ntfs2gtfs/Cargo.toml b/ntfs2gtfs/Cargo.toml index 0860dbbfb..8af09fe4f 100644 --- a/ntfs2gtfs/Cargo.toml +++ b/ntfs2gtfs/Cargo.toml @@ -22,5 +22,5 @@ slog-scope = "4.1" slog-stdlog = "4.0" slog-term = "2.4" structopt = "0.3" -transit_model = { version = "0.34", path = "../" } +transit_model = { version = "0.35", path = "../" } lazy_static = "1" diff --git a/ntfs2netexfr/Cargo.toml b/ntfs2netexfr/Cargo.toml index 81fb47786..d0ec63968 100644 --- a/ntfs2netexfr/Cargo.toml +++ b/ntfs2netexfr/Cargo.toml @@ -22,5 +22,5 @@ slog-scope = "4.1" slog-stdlog = "4.0" slog-term = "2.4" structopt = "0.3" -transit_model = { version = "0.34", path = "../", features = ["proj"] } +transit_model = { version = "0.35", path = "../", features = ["proj"] } lazy_static = "1" diff --git a/ntfs2ntfs/Cargo.toml b/ntfs2ntfs/Cargo.toml index c624281e3..e1b3a73ef 100644 --- a/ntfs2ntfs/Cargo.toml +++ b/ntfs2ntfs/Cargo.toml @@ -22,5 +22,5 @@ slog-scope = "4.1" slog-stdlog = "4.0" slog-term = "2.4" structopt = "0.3" -transit_model = { version = "0.34", path = "../" } +transit_model = { version = "0.35", path = "../" } lazy_static = "1" diff --git a/restrict-validity-period/Cargo.toml b/restrict-validity-period/Cargo.toml index fa8f853f0..2d1b95769 100644 --- a/restrict-validity-period/Cargo.toml +++ b/restrict-validity-period/Cargo.toml @@ -21,4 +21,4 @@ slog-scope = "4.1" slog-stdlog = "4.0" slog-term = "2.4" structopt = "0.3" -transit_model = { version = "0.34", path = "../" } +transit_model = { version = "0.35", path = "../" }