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

Exporting with a dot for current directory throws a Go error #19

Open
johncblandii opened this issue Apr 22, 2020 · 1 comment
Open

Comments

@johncblandii
Copy link
Contributor

johncblandii commented Apr 22, 2020

Problem

➜ variant export binary . mycli

When exporting a binary, the path must be a directory name or an absolute path. Using the . throw an error.

Error

go: malformed import path ".": invalid path element "."
Error: command "sh -c cd /var/folders/bt/6rr5l1js5w3_49gm0pvqh7wr0000gn/T/variant-.509876642; go mod init . && go build -o /cli/mycli /var/folders/bt/6rr5l1js5w3_49gm0pvqh7wr0000gn/T/variant-.509876642": exit status 1

Possible Solutions

  • Expand the path of the first argument . to the relative or absolute path
  • Falling back to the second arg as the arg passed to go mod init
@johncblandii
Copy link
Contributor Author

Since I was building in make, my fix was:

build:
	variant export binary $(CURDIR) mycli

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