mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-24 04:32:52 +01:00
improve xtask repo root check to not break our fork CI#
This commit is contained in:
parent
d172df6f0a
commit
7ce4391e4e
1 changed files with 4 additions and 3 deletions
|
@ -4,7 +4,6 @@ mod command;
|
||||||
use anyhow::bail;
|
use anyhow::bail;
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
use std::{
|
use std::{
|
||||||
env,
|
|
||||||
error::Error,
|
error::Error,
|
||||||
ffi::OsString,
|
ffi::OsString,
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
|
@ -68,8 +67,10 @@ impl fmt::Display for TestRunError {
|
||||||
impl Error for TestRunError {}
|
impl Error for TestRunError {}
|
||||||
|
|
||||||
fn main() -> anyhow::Result<()> {
|
fn main() -> anyhow::Result<()> {
|
||||||
let execution_dir = env::current_dir()?;
|
// if there's an `xtask` folder, we're *probably* at the root of this repo (we can't just
|
||||||
if execution_dir.file_name().unwrap() != "cortex-m-rtic" {
|
// check the name of `env::current_dir()` because people might clone it into a different name)
|
||||||
|
let probably_running_from_repo_root = Path::new("./xtask").exists();
|
||||||
|
if probably_running_from_repo_root == false {
|
||||||
bail!("xtasks can only be executed from the root of the `cortex-m-rtic` repository");
|
bail!("xtasks can only be executed from the root of the `cortex-m-rtic` repository");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue