cheat / snap

Snap recipe for cheat
Other
12 stars 4 forks source link

Missing config options in cheat break snap install #11

Closed bernermic closed 2 years ago

bernermic commented 2 years ago

Hi @chrisallenlane, I face an issue with building the latest cheat version.

Issue description

cheat version 4.3.0 does not work with snap.

~ » cheat tar                                                                                                                                                                                                             
panic: interface conversion: interface {} is nil, not bool

goroutine 1 [running]:
main.main()
    github.com/cheat/cheat/cmd/cheat/main.go:123 +0xa45

Seems to me the snap version is missing some config options? Do you have an idea how best to solve this? Problem seems to come from this: https://github.com/cheat/cheat/blob/master/cmd/cheat/main.go#L123

Reproduce

sudo snap install cheat --beta
cheat -v                                                                                                                                                                                                            
**4.3.3**
cheat tar 

Best Michael

chrisallenlane commented 2 years ago

@bernermic, this is very weird :thinking:

That error seems to occur if main.go references an option that has not been declared within docopt.txt. I verified this by inserting the following lines at line 123 on master:

case opts["--conf"].(bool):
    cmd = cmdConf

Doing that produces the error that you're seeing. (master otherwise builds and runs successfully on HEAD upstream, however.)

I'm unfortunately rather ignorant of the process involved in building a snap package, but is it possible that the docopt.txt file has somehow gone stale? Does the build process involve any cache that can be cleaned?

bernermic commented 2 years ago

@chrisallenlane I solved the issue now with packaging the released github binary and it works fine. Thanks for looking into my question :)

chrisallenlane commented 2 years ago

Sounds great, @bernermic. Thanks!