Skip to content

Commit

Permalink
ref: Print better error when processing appcenter paths (#1287)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilogorek committed Jul 14, 2022
1 parent 44f3f05 commit 6e0c231
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/commands/react_native/appcenter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::env;
use std::ffi::OsStr;
use std::fs;

use anyhow::Result;
use anyhow::{anyhow, Result};
use clap::{Arg, ArgMatches, Command};
use console::style;
use if_chain::if_chain;
Expand Down Expand Up @@ -134,7 +134,10 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
let mut processor = SourceMapProcessor::new();

for path in matches.values_of("paths").unwrap() {
for entry in (fs::read_dir(path)?).flatten() {
let entries = fs::read_dir(path)
.map_err(|e| anyhow!(e).context(format!("Failed processing path: \"{}\"", &path)))?;

for entry in entries.flatten() {
if_chain! {
if let Some(filename) = entry.file_name().to_str();
if let Some(ext) = entry.path().extension();
Expand Down

0 comments on commit 6e0c231

Please sign in to comment.