crhuber / kelp

A simple alternative to homebrew for installing binary packages on MacOS written in Go.
35 stars 2 forks source link

kelp init fails #2 #14

Closed untcha closed 9 months ago

untcha commented 9 months ago

It's me again 😄

kelp init still fails, because it cannot write the kelp.json

I did not dig deeper into it, but found this: https://github.com/crhuber/kelp/blob/e183abc41c3d42e0b7b32da83a09e966d582d750/pkg/config/config.go#L90

and this: https://github.com/crhuber/kelp/blob/e183abc41c3d42e0b7b32da83a09e966d582d750/pkg/config/config.go#L34

I build kelp with the KelpConfig variable and then it works as expected.

crhuber commented 9 months ago

it needs to be able to write to ~/.kelp/kelp.json . so maybe theres an issue writing there

untcha commented 9 months ago

The path is writable. That seems not to be the problem.

The string kc.Path is empty and therefor no destination to write to.

untcha commented 9 months ago

I think the problem is here:

https://github.com/crhuber/kelp/blob/e183abc41c3d42e0b7b32da83a09e966d582d750/pkg/config/config.go#L274-L282

When there is no config existing, then you create the KelpPackage and append it to the KelpConfig but the KelpConfig does not have the path set.

I solved it by adding:

kc.Path = path
untcha commented 9 months ago

Fixed with release v.1.12.4