mumoshu / variant2

Turn your bash scripts into a modern, single-executable CLI app today
MIT License
140 stars 11 forks source link

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

Open johncblandii opened 4 years ago

johncblandii commented 4 years ago

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

johncblandii commented 4 years ago

Since I was building in make, my fix was:

build:
    variant export binary $(CURDIR) mycli