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

Not executing backtick command in --proto_path #160

Open
meling opened this issue Jun 17, 2023 · 0 comments
Open

Not executing backtick command in --proto_path #160

meling opened this issue Jun 17, 2023 · 0 comments

Comments

@meling
Copy link

meling commented Jun 17, 2023

In several of my projects I use a configuration like this (and it works fine):

"options": [
	"--proto_path=${workspaceRoot}/",
	"--proto_path=`go list -m -f {{.Dir}} github.com/relab/gorums`",
	"--go_out=proto/"
]

However, I'm trying to set up the same in an another project, but I cannot seem to get it to work. I get this error and the plugin show errors in the Problems pane:

`go list -m -f {{.Dir}} github.com/relab/gorums`: warning: directory does not exist. gorums.proto: File not found.

If I run the command go list -m -f {{.Dir}} github.com/relab/gorums in the terminal and copy the output, the errors go away and all is fine:

"options": [
	"--proto_path=${workspaceRoot}/",
	"--proto_path=/Users/meling/go/pkg/mod/github.com/relab/[email protected]",
	"--go_out=proto/"
]

I've also tried with the $(shell ...) thing:

"options": [
	"--proto_path=${workspaceRoot}/",
	"--proto_path=$(shell go list -m -f {{.Dir}} github.com/relab/gorums)",
	"--go_out=proto/"
]

Anyone know what could be the problem?

PS: The reason for using the command to populate the proto_path is so that I can commit the settings.json to git and allow other developers get this working out of the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant