Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

nitro remove hinting not 0 based. #104

Closed
pieterjandebruyne opened this issue May 6, 2020 · 4 comments
Closed

nitro remove hinting not 0 based. #104

pieterjandebruyne opened this issue May 6, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@pieterjandebruyne
Copy link

Nitro remove passes 1 as default instead of 0 to remove the first element.
$ nitro remove

 1 - myproject-dev
Select a site to remove? [1] 
panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
github.com/pixelandtonic/prompt.(*Prompt).Select(0xc00020fca0, 0x15469cb, 0x17, 0xc000189c20, 0x1, 0x1, 0xc00020fc88, 0x0, 0x1155fcb, 0x14c24a0, ...)
	/pkg/mod/github.com/pixelandtonic/prompt@v0.0.0-20200505130838-0cbd21e84462/prompt.go:125 +0x5f9
github.com/craftcms/nitro/internal/cmd.glob..func13(0x192d3e0, 0x19623c0, 0x0, 0x0, 0x0, 0x0)
	/src/github.com/craft/nitro/internal/cmd/remove.go:34 +0x200
github.com/spf13/cobra.(*Command).execute(0x192d3e0, 0x19623c0, 0x0, 0x0, 0x192d3e0, 0x19623c0)
	/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:826 +0x453
github.com/spf13/cobra.(*Command).ExecuteC(0x192db60, 0x0, 0x0, 0x0)
	/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:914 +0x2fb
github.com/spf13/cobra.(*Command).Execute(...)
	/pkg/mod/github.com/spf13/cobra@v0.0.5/command.go:864
github.com/craftcms/nitro/internal/cmd.Execute()
	/src/github.com/craft/nitro/internal/cmd/root.go:52 +0x2d
main.main()
	/src/github.com/craft/nitro/cmd/cli/main.go:8 +0x20

@pieterjandebruyne
Copy link
Author

This also happens with "nitro import " when you choose which database engine to import into.

@jasonmccallister
Copy link
Contributor

Thank you for the report @pieter-janDB. We swapped out prompt package for our own yesterday that has better windows support (https://github.com/pixelandtonic/prompt) and I missed that. I'll get this ready for the next release!

@jasonmccallister
Copy link
Contributor

This has been pushed to develop and will be ready for the next release.

@jasonmccallister
Copy link
Contributor

@pieter-janDB I just tagged 1.0.0-beta.2 which should resolve this issue.

You can run nitro self-update to get the latest version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants