mirror of
https://github.com/pesde-pkg/pesde.git
synced 2024-12-12 11:00:36 +00:00
fix(cli config): create folder for config
This commit is contained in:
parent
056d1dce36
commit
12407fa6de
3 changed files with 7 additions and 5 deletions
|
@ -30,4 +30,4 @@ sentry-log = "0.32.2"
|
|||
sentry-actix = "0.32.2"
|
||||
|
||||
# zstd-sys v2.0.10 is broken: https://github.com/gyscos/zstd-rs/issues/268
|
||||
zstd-sys = "=2.0.9+zstd.1.5.5"
|
||||
zstd-sys = "=2.0.9"
|
|
@ -20,6 +20,7 @@ use reqwest::{
|
|||
use semver::{Version, VersionReq};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{
|
||||
fs::create_dir_all,
|
||||
hash::{DefaultHasher, Hash, Hasher},
|
||||
path::PathBuf,
|
||||
str::FromStr,
|
||||
|
@ -173,9 +174,10 @@ impl CliConfig {
|
|||
}
|
||||
|
||||
pub fn write(&self) -> anyhow::Result<()> {
|
||||
let cli_config_path = DIRS.config_dir().join("config.yaml");
|
||||
let folder = DIRS.config_dir();
|
||||
create_dir_all(folder)?;
|
||||
serde_yaml::to_writer(
|
||||
&mut std::fs::File::create(cli_config_path.as_path())?,
|
||||
&mut std::fs::File::create(folder.join("config.yaml"))?,
|
||||
&self,
|
||||
)?;
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ pub enum EscapedPackageNameError<E> {
|
|||
Invalid(String),
|
||||
|
||||
/// The package name is invalid
|
||||
#[error("invalid package name")]
|
||||
#[error(transparent)]
|
||||
InvalidName(#[from] E),
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ pub enum FromStrPackageNameParseError<E> {
|
|||
Invalid(String),
|
||||
|
||||
/// The package name is invalid
|
||||
#[error("invalid name part")]
|
||||
#[error(transparent)]
|
||||
InvalidPart(#[from] E),
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue