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

add error enum to turborepo-dirs #7277

Merged
merged 1 commit into from Feb 14, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/turborepo-dirs/Cargo.toml
Expand Up @@ -8,6 +8,7 @@ license = "MPL-2.0"

[dependencies]
dirs-next = "2.0.0"
thiserror.workspace = true
Copy link
Contributor

Choose a reason for hiding this comment

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

guessing yes, but is the same as below?

Suggested change
thiserror.workspace = true
thiserror = { workspace = true }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah they're the same, I think cargo defaults to this version if you don't specify things like features. I'm sure there's some configuration I can do somewhere to fix this but I haven't taken the time to deal with it yet  😁


[lints]
workspace = true
7 changes: 7 additions & 0 deletions crates/turborepo-dirs/src/lib.rs
@@ -1,6 +1,7 @@
use std::path::PathBuf;

use dirs_next::config_dir as dirs_config_dir;
use thiserror::Error;

/// Returns the path to the user's configuration directory. This is a wrapper
/// around `dirs_next::config_dir` that also checks the `TURBO_CONFIG_DIR_PATH`
Expand All @@ -23,3 +24,9 @@ pub fn vercel_config_dir() -> Option<PathBuf> {
}
dirs_config_dir()
}

#[derive(Debug, Error)]
pub enum Error {
#[error("config directory not found")]
ConfigDirNotFound,
}