Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Layerform should just create the local context directory instead of erroring out #61

Closed
vieiralucas opened this issue Sep 7, 2023 · 6 comments
Labels
good first issue Good for newcomers

Comments

@vieiralucas
Copy link
Member

When the user configures a context of type local it also has to provide the dir for the state and definitions to be saved to. Currently, if that directory is non existing, layerform just errors out, see video.

configure-invalid-context-dir.mov
@vieiralucas vieiralucas added the good first issue Good for newcomers label Sep 7, 2023
@vieiralucas
Copy link
Member Author

vieiralucas commented Sep 7, 2023

To fix this, we should just add code before this os.WriteFile below to ensure the directory exists. Just use os.MkdirAll
https://github.com/ergomake/layerform/blob/8bc84274fa6389bc10cb95af8dcde15ab2eff368/internal/storage/file.go#L51

@Mihai22125
Copy link

Hi @vieiralucas, I'd like to work on this issue. Can you assign it to me, please?

@vieiralucas
Copy link
Member Author

Hi @Mihai22125, thanks for being interested in contributing. I just spoke with @lanjoni about this one actually.
What do you think about #62? I'm happy to provide further guidance on that one.

@Mihai22125
Copy link

Hi @vieiralucas, no problem. I'd be happy to work on #62 instead

@vieiralucas
Copy link
Member Author

vieiralucas commented Sep 7, 2023

Awesome, thank you so much @Mihai22125, feel free to ping me there if you need further assistance, very happy to have new contributors to the project.
If you want. Can you please make a comment there similar to the one you made here? So that I can assign it to you?

@vieiralucas
Copy link
Member Author

Closed by #63

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants