Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hugo mod get without arguments fails with 0.115.0 #11190

Closed
ITler opened this issue Jun 30, 2023 · 4 comments
Closed

hugo mod get without arguments fails with 0.115.0 #11190

ITler opened this issue Jun 30, 2023 · 4 comments

Comments

@ITler
Copy link

ITler commented Jun 30, 2023

What version of Hugo are you using (hugo version)?

$ hugo version
v0.115.0-67caf50698783d3b3d78559ac81483d83e5e1a35+extended linux/amd64 BuildDate=2023-06-29T15:56:39Z VendorInfo=gohugoio

$ go version
go version go1.20.3 linux/amd64

Does this issue reproduce with the latest release?

yes

$ hugo mod get
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/gohugoio/hugo/commands.newModCommands.func16({0x2a6ee00?, 0xc000014018?}, 0xc000d9fbb8?, 0x89d94b?, {0x3c93e60?, 0x4?, 0xc00012db80?})
	/root/project/hugo/commands/mod.go:227 +0x22e
github.com/gohugoio/hugo/commands.(*simpleCommand).Run(0x1?, {0x2a7d558?, 0xc00004a120?}, 0x0?, {0x3c93e60?, 0xc000133f20?, 0xc000d9fbd0?})
	/root/project/hugo/commands/commandeer.go:597 +0x43
github.com/bep/simplecobra.(*Commandeer).compile.func1(0xc0003d7420?, {0x3c93e60?, 0x0?, 0x0?})
	/root/project/gomodcache/github.com/bep/simplecobra@v0.3.2/simplecobra.go:113 +0x52
github.com/spf13/cobra.(*Command).execute(0xc000d7e000, {0x3c93e60, 0x0, 0x0})
	/root/project/gomodcache/github.com/spf13/cobra@v1.7.0/command.go:940 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0xc000a5a600)
	/root/project/gomodcache/github.com/spf13/cobra@v1.7.0/command.go:1068 +0x3bd
github.com/spf13/cobra.(*Command).ExecuteContextC(...)
	/root/project/gomodcache/github.com/spf13/cobra@v1.7.0/command.go:1001
github.com/bep/simplecobra.(*Exec).Execute(0xc000618240, {0x2a7d558?, 0xc00004a120?}, {0xc000040190?, 0x509b88?, 0xc000081168?})
	/root/project/gomodcache/github.com/bep/simplecobra@v0.3.2/simplecobra.go:155 +0xd9
github.com/gohugoio/hugo/commands.Execute({0xc000040190, 0x2, 0x2})
	/root/project/hugo/commands/commandeer.go:66 +0x312
main.main()
	/root/project/hugo/main.go:25 +0x65

executing hugo mod get -u works fine

@bep bep added this to the v0.115.0 milestone Jun 30, 2023
@bep bep changed the title hugo mod get fails with 0.1.115 hugo mod get without arguments fails with 0.1.115 Jun 30, 2023
@bep
Copy link
Member

bep commented Jun 30, 2023

I guess you can do

hugo mod get .

@bep bep modified the milestones: v0.115.0, v0.116.0 Jun 30, 2023
@bep bep removed the NeedsTriage label Jun 30, 2023
@bep bep closed this as completed in 0ff8e13 Jun 30, 2023
@bep bep modified the milestones: v0.116.0, v0.115.1 Jun 30, 2023
@ITler
Copy link
Author

ITler commented Jun 30, 2023

Sorry, but this also does fail

$ hugo mod get .
go: .: no package to get in current directory
Error: failed to get ["-d" "."]: failed to execute 'go [get -d .]': failed to execute binary "go" with args [get -d .]: go: .: no package to get in current directory
 *errors.errorString

@ITler ITler changed the title hugo mod get without arguments fails with 0.1.115 hugo mod get without arguments fails with 0.115.0 Jun 30, 2023
@ITler
Copy link
Author

ITler commented Jun 30, 2023

@bep may I kindly ask to have a look again

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants