Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: Print better error when processing appcenter paths #1287

Merged
merged 1 commit into from
Jul 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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)))?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


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