Skip to content

set stdin default config path to current dir #2663

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

Merged
merged 1 commit into from
Apr 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extern crate rustfmt_nightly as rustfmt;
use std::env;
use std::fs::File;
use std::io::{self, stdout, Read, Write};
use std::path::PathBuf;
use std::path::{Path, PathBuf};

use failure::err_msg;

Expand Down Expand Up @@ -182,7 +182,7 @@ fn execute(opts: &Options) -> FmtResult<(WriteMode, Summary)> {
Operation::Stdin { input } => {
// try to read config from local directory
let options = CliOptions::from_matches(&matches)?;
let (mut config, _) = load_config(None, Some(&options))?;
let (mut config, _) = load_config(Some(Path::new(".")), Some(&options))?;

// write_mode is always Plain for Stdin.
config.set().write_mode(WriteMode::Plain);
Expand Down