Preface: It is my understanding that apx is not meant to be run as a root user. Though I would say its preferable to display a tip/warning or guide the user to relevant documentation instead of panicking.
- autoremove
- clean
- export
- init
- install
- list
- purge
- run
- remove
- search
- show
- unexport
- update
- upgrade
- version
I.e. all except help
(prints help message as expected) and enter
(cannot find the associated managed container).
user@vanilla:~$ sudo apx --dnf update
⣾ Creating container...⌬ Apx :: exit status 1
panic: exit status 1
goroutine 1 [running]:
log.Panic({0xc00014bba0?, 0x16?, 0xc00014bbb0?})
log/log.go:388 +0x65
github.com/vanilla-os/apx/core.CreateContainer({0x880ff3, 0x3})
github.com/vanilla-os/apx/core/container.go:188 +0x35b
github.com/vanilla-os/apx/core.RunContainer({0x880ff3, 0x3}, {0xc00015c9c0, 0x4, 0x0?})
github.com/vanilla-os/apx/core/container.go:108 +0x7e
github.com/vanilla-os/apx/cmd.update(0xc0001ac280?, {0xc000111a20, 0x0, 0x1?})
github.com/vanilla-os/apx/cmd/update.go:63 +0x2ee
github.com/spf13/cobra.(*Command).execute(0xc0001ac280, {0xc000111a10, 0x1, 0x1})
github.com/spf13/cobra/command.go:872 +0x694
github.com/spf13/cobra.(*Command).ExecuteC(0xc00012bb80)
github.com/spf13/cobra/command.go:990 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/cobra/command.go:918
main.main()
github.com/vanilla-os/apx/main.go:87 +0x672