这是indexloc提供的服务,不要输入任何密码
Skip to content

turbo prune sefaults when given unexpected argument. #1258

@obmarg

Description

@obmarg

What version of Turborepo are you using?

1.2.9

What package manager are you using / does the bug impact?

pnpm

What operating system are you using?

Mac

Describe the Bug

I was looking for the command line options for turbo prune so I ran turbo prune help and got a segfault:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x90 pc=0x145cf1c]

goroutine 1 [running]:
github.com/vercel/turborepo/cli/internal/prune.(*PruneCommand).Run(0xc000216050, {0xc00010c1a0?, 0x1fbb1b0?, 0x60?})
	github.com/vercel/turborepo/cli/internal/prune/prune.go:87 +0x3c
github.com/mitchellh/cli.(*CLI).Run(0xc00016da40)
	github.com/mitchellh/cli@v1.1.2/cli.go:262 +0x5f8
main.main.func9(0x0?, {0x0?, 0x1592cc2?}, {0xc00010c190?, 0x2, 0x2}, {0x0?, 0x1976e40?}, {0x0, 0x0}, ...)
	github.com/vercel/turborepo/cli/cmd/turbo/main.go:173 +0x445
main.main()
	github.com/vercel/turborepo/cli/cmd/turbo/main.go:178 +0xb25

I realise the argument I wanted is --help, but this seems like bad behaviour for a CLI app.

Expected Behavior

Turbo exits with a helpful error message of some kind.

To Reproduce

  1. Run turbo prune help

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions