mirror of
https://github.com/ilyakooo0/reshape.git
synced 2024-09-11 10:25:29 +03:00
Output the failing filename when showing a parse error (#13)
Co-authored-by: April Schleck <april@exclusivelyducks.com>
This commit is contained in:
parent
b626ee119f
commit
ce7a0b38ee
@ -4,6 +4,7 @@ use std::{
|
||||
path::Path,
|
||||
};
|
||||
|
||||
use anyhow::{Context};
|
||||
use clap::{Args, Parser};
|
||||
use reshape::{
|
||||
migrations::{Action, Migration},
|
||||
@ -211,7 +212,8 @@ fn find_migrations(opts: &FindMigrationsOptions) -> anyhow::Result<Vec<Migration
|
||||
.map(|result| {
|
||||
result.and_then(|(path, data)| {
|
||||
let extension = path.extension().and_then(|ext| ext.to_str()).unwrap();
|
||||
let file_migration = decode_migration_file(&data, extension)?;
|
||||
let file_migration = decode_migration_file(&data, extension)
|
||||
.with_context(|| format!("failed to parse migration file {}", path.display()))?;
|
||||
|
||||
let file_name = path.file_stem().and_then(|name| name.to_str()).unwrap();
|
||||
Ok(Migration {
|
||||
|
Loading…
Reference in New Issue
Block a user