cli: make the entire +ssh-cache cache path (#9403)

std.fs.makeDirAbsolute() only creates the last directory. We instead
need Dir.makePath() to make the entire path, including intermediate
directories.

This fixes the problem where a missing $XDG_STATE_HOME directory (e.g.
~/.local/state/) would prevent our ssh cache file from being created.

Fixes #9393
pull/8960/merge
Jon Parise 2025-10-30 00:29:40 -04:00 committed by GitHub
parent 5edf9aff50
commit 4818c2b896
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -70,7 +70,7 @@ pub fn add(
// Create cache directory if needed // Create cache directory if needed
if (std.fs.path.dirname(self.path)) |dir| { if (std.fs.path.dirname(self.path)) |dir| {
std.fs.makeDirAbsolute(dir) catch |err| switch (err) { std.fs.cwd().makePath(dir) catch |err| switch (err) {
error.PathAlreadyExists => {}, error.PathAlreadyExists => {},
else => return err, else => return err,
}; };