mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: create config directory to resolve package.toml creation error
Create the config directory for Yazi to resolve the issue where `package.toml` cannot be created when the config directory is missing.
This commit is contained in:
parent
456b88d660
commit
841957979f
1 changed files with 7 additions and 3 deletions
|
|
@ -4,9 +4,13 @@ use anyhow::Context;
|
||||||
use yazi_fs::Xdg;
|
use yazi_fs::Xdg;
|
||||||
|
|
||||||
pub(super) fn init() -> anyhow::Result<()> {
|
pub(super) fn init() -> anyhow::Result<()> {
|
||||||
let root = Xdg::state_dir().join("packages");
|
let packages_root = Xdg::state_dir().join("packages");
|
||||||
std::fs::create_dir_all(&root)
|
std::fs::create_dir_all(&packages_root)
|
||||||
.with_context(|| format!("failed to create packages directory: {root:?}"))?;
|
.with_context(|| format!("failed to create packages directory: {packages_root:?}"))?;
|
||||||
|
|
||||||
|
let config_root = Xdg::config_dir();
|
||||||
|
std::fs::create_dir_all(&config_root)
|
||||||
|
.with_context(|| format!("failed to create config directory: {config_root:?}"))?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue