From d6f1262c1cce60c3c509e8f6a10782b346ea800e Mon Sep 17 00:00:00 2001 From: ByteDream Date: Mon, 27 Feb 2023 11:17:32 +0100 Subject: [PATCH] Fix no such file or directory when using login (#164) --- crunchy-cli-core/src/cli/login.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crunchy-cli-core/src/cli/login.rs b/crunchy-cli-core/src/cli/login.rs index c41b1b7..f164a0b 100644 --- a/crunchy-cli-core/src/cli/login.rs +++ b/crunchy-cli-core/src/cli/login.rs @@ -18,6 +18,8 @@ pub struct Login { impl Execute for Login { async fn execute(self, ctx: Context) -> Result<()> { if let Some(login_file_path) = login_file_path() { + fs::create_dir_all(login_file_path.parent().unwrap())?; + match ctx.crunchy.session_token().await { SessionToken::RefreshToken(refresh_token) => Ok(fs::write( login_file_path,