mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-21 23:01:05 +00:00
fix: ya pkg fails to write package.toml when the config directory does not exist (#3482)
Co-authored-by: sxyazi <sxyazi@gmail.com>
This commit is contained in:
parent
456b88d660
commit
0000141700
2 changed files with 12 additions and 3 deletions
|
|
@ -16,6 +16,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/):
|
|||
|
||||
- Support VFS for preset previewers that rely on external commands ([#3477])
|
||||
|
||||
### Fixed
|
||||
|
||||
- `ya pkg` fails to write `package.toml` when the config directory does not exist ([#3482])
|
||||
|
||||
## [v25.12.29]
|
||||
|
||||
### Added
|
||||
|
|
@ -1571,3 +1575,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/):
|
|||
[#3456]: https://github.com/sxyazi/yazi/pull/3456
|
||||
[#3467]: https://github.com/sxyazi/yazi/pull/3467
|
||||
[#3477]: https://github.com/sxyazi/yazi/pull/3477
|
||||
[#3482]: https://github.com/sxyazi/yazi/pull/3482
|
||||
|
|
|
|||
|
|
@ -4,9 +4,13 @@ use anyhow::Context;
|
|||
use yazi_fs::Xdg;
|
||||
|
||||
pub(super) fn init() -> anyhow::Result<()> {
|
||||
let root = Xdg::state_dir().join("packages");
|
||||
std::fs::create_dir_all(&root)
|
||||
.with_context(|| format!("failed to create packages directory: {root:?}"))?;
|
||||
let packages_dir = Xdg::state_dir().join("packages");
|
||||
std::fs::create_dir_all(&packages_dir)
|
||||
.with_context(|| format!("failed to create packages directory: {packages_dir:?}"))?;
|
||||
|
||||
let config_dir = Xdg::config_dir();
|
||||
std::fs::create_dir_all(&config_dir)
|
||||
.with_context(|| format!("failed to create config directory: {config_dir:?}"))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue