Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows CLI does not create ~/.zarf-cache directory. #985

Closed
JasonvanBrackel opened this issue Nov 8, 2022 · 1 comment · Fixed by #1096
Closed

Windows CLI does not create ~/.zarf-cache directory. #985

JasonvanBrackel opened this issue Nov 8, 2022 · 1 comment · Fixed by #1096
Labels
bug 🐞 Something isn't working

Comments

@JasonvanBrackel
Copy link
Contributor

Environment

Device and OS: Windows 11
App version: Zarf v0.22.2
Kubernetes distro being used: N/A
Other:

Steps to reproduce

  1. Run "zarf init"

Expected result

Zarf downloads the zarf init package C:\Users<user>.zarf-cache

Actual Result

PS C:\Users\jason> zarf init

Saving log file to C:\Users\jason\AppData\Local\Temp\zarf-2022-11-08-10-11-55-1722182145.log

...

It seems the init package could not be found locally, but can be downloaded from
https://github.com/defenseunicorns/zarf/releases/download/v0.22.2/zarf-init-amd64-v0.22.2.tar.zst

? Do you want to download this init package? Yes
     ERROR:  Unable to create the destination file y

You can workaround by creating the ~/.zarf_cache directory

Visual Proof (screenshots, videos, text, etc)

image

@RothAndrew RothAndrew moved this to New Requests in Zarf Project Board Nov 8, 2022
@JasonvanBrackel JasonvanBrackel moved this from New Requests to Backlog in Zarf Project Board Nov 8, 2022
@Noxsios
Copy link
Contributor

Noxsios commented Nov 15, 2022

This can be fixed w/ the below addition to https://github.com/defenseunicorns/zarf/blob/878a409930aa4893af7be529bc2acf74e32c798f/src/cmd/initialize.go#L72:

// src/cmd/initialize.go
err = os.MkdirAll(config.GetAbsCachePath(), 0755)
if err != nil {
  message.Fatalf(err, "Unable to create cache directory: %s", config.GetAbsCachePath())
}

Will make a PR branch tomorrow.

@Noxsios Noxsios linked a pull request Nov 18, 2022 that will close this issue
1 task
jeff-mccoy pushed a commit that referenced this issue Dec 6, 2022
Carry over from #1027 , w/ updates from MZAL. Did not feel like fixing
merge conflicts.

Fixes #985 

Handles creation of `~/.zarf-cache` during `zarf init` if it does not
exist.
Repository owner moved this from Backlog to Done in Zarf Project Board Dec 6, 2022
Noxsios added a commit that referenced this issue Mar 8, 2023
Carry over from #1027 , w/ updates from MZAL. Did not feel like fixing
merge conflicts.

Fixes #985 

Handles creation of `~/.zarf-cache` during `zarf init` if it does not
exist.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐞 Something isn't working
Projects
None yet
2 participants