Skip to content

Commit

Permalink
fix(turborepo): Passing a relative path to --cwd when using --skip-in…
Browse files Browse the repository at this point in the history
…fer. (vercel#3348)

Allows user to pass relative path to `--cwd` instead of erroring while using `--skip-infer`
  • Loading branch information
NicholasLYang authored Jan 17, 2023
1 parent 1194330 commit 015b787
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/turborepo-lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::{env, io, mem, path::PathBuf, process};
use anyhow::{anyhow, Result};
use clap::{ArgAction, CommandFactory, Parser, Subcommand, ValueEnum};
use clap_complete::{generate, Shell};
use dunce::canonicalize as fs_canonicalize;
use log::error;
use serde::Serialize;

Expand Down Expand Up @@ -376,6 +377,10 @@ pub fn run(repo_state: Option<RepoState>) -> Result<Payload> {
clap_args.cwd = Some(repo_state.root);
}

if let Some(cwd) = &clap_args.cwd {
clap_args.cwd = Some(fs_canonicalize(cwd)?);
}

match clap_args.command.as_ref().unwrap() {
Command::Bin { .. } => {
bin::run()?;
Expand Down

0 comments on commit 015b787

Please sign in to comment.