MIERUNE/plateau-gis-converter

transformer: トランスフォーム後に地物が存在しない場合のエラーハンドリング

Opened this issue · 0 comments

  • エラー時に出力フォルダが生成されてしまう。

src/main.rs

// If the directory for the output path does not exist, create it
      if let Some(output_parent_dir) = PathBuf::from(&args.output).parent() {
          if !output_parent_dir.exists() {
              if std::fs::create_dir_all(output_parent_dir).is_err() {
                  log::error!("Failed to create output directory: {:?}", output_parent_dir);
                  return ExitCode::FAILURE;
              };
              log::info!("Created output directory: {:?}", output_parent_dir);
          }
      }