Closed jshin closed 2 years ago
Debug log is here.
$ AFX_LOG=debug afx install
2022/03/24 00:23:59 [INFO] afx version: unset
2022/03/24 00:23:59 [INFO] Go runtime version: go1.18
2022/03/24 00:23:59 [INFO] Build tag/SHA: unset/unset
2022/03/24 00:23:59 [INFO] CLI args: []string{"afx", "install"}
2022/03/24 00:23:59 [INFO] Reading config /home/jshin/.config/afx/github.yaml...
2022/03/24 00:23:59 [DEBUG] (goroutine): checking new updates...
2022/03/24 00:23:59 [INFO] Parsing config...
2022/03/24 00:23:59 [DEBUG] mkdir /home/jshin/.afx
2022/03/24 00:23:59 [DEBUG] mkdir /home/jshin/bin
2022/03/24 00:23:59 [ERROR] there're some states or packages which needs operations: cannot refresh state
2022/03/24 00:23:59 [INFO] state additions: (5) []string{"zdharma-continuum/fast-syntax-highlighting", "b4b4r07/enhancd", "tmux-plugins/tpm", "zsh-users/zsh-completions", "zsh-users/zsh-autosuggestions"}
2022/03/24 00:23:59 [INFO] state deletions: (0) []string(nil)
2022/03/24 00:23:59 [INFO] state changes: (0) []string(nil)
2022/03/24 00:23:59 [INFO] state unchanges: (0) []string{...skip...}
? OK to install these packages? zdharma-continuum/fast-syntax-highlighting, b4b4r07/enhancd, tmux-plugins/tpm, ... (5 packages) Yes
2022/03/24 00:24:00 [DEBUG] (install): start to run each pkg.Install()
2022/03/24 00:24:00 [DEBUG] zsh-users/zsh-completions: added to state
panic: assignment to entry in nil map
goroutine 16 [running]:
github.com/b4b4r07/afx/pkg/state.add(...)
/home/jshin/go/pkg/mod/github.com/b4b4r07/afx@v0.1.19/pkg/state/state.go:122
github.com/b4b4r07/afx/pkg/state.(*State).Add(0xc000379cc0?, {0x7fe23ca088d8?, 0xc0000be900?})
/home/jshin/go/pkg/mod/github.com/b4b4r07/afx@v0.1.19/pkg/state/state.go:287 +0x1b3
github.com/b4b4r07/afx/cmd.(*installCmd).run.func2()
/home/jshin/go/pkg/mod/github.com/b4b4r07/afx@v0.1.19/cmd/install.go:120 +0x1c5
golang.org/x/sync/errgroup.(*Group).Go.func1()
/home/jshin/go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:57 +0x67
created by golang.org/x/sync/errgroup.(*Group).Go
/home/jshin/go/pkg/mod/golang.org/x/sync@v0.0.0-20210220032951-036812b2e83c/errgroup/errgroup.go:54 +0x8d
Thank you for the report and sorry for inconvenience. It has been fixed now in latest version.
Thank you for fixing it!
WHY
When executing
afx install
, panic occurs with the following error message and the installation fails.Environment
OS : Ubuntu 20.04.4 Go : 1.18 afx version : v0.1.19 yaml file