From 5a268dc5a369cf2c034852aee7c58216e0f02ec3 Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Tue, 15 Sep 2020 17:10:12 +0900 Subject: [PATCH] Fix run via shebang to not fail due to redundant/repeated args There was a regression in the shebang support, that resulted in `./myapp` to be internally treated as `variant run variant run myapp`, which hs been giving you `Error: accepts between 0 and 0 arg(s), received 2` errors. --- variant.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/variant.go b/variant.go index b67c0c9..5ea1889 100644 --- a/variant.go +++ b/variant.go @@ -140,9 +140,7 @@ func GetPathAndArgsFromEnv(env Env) (string, string, []string) { info, err := os.Stat(file) if err == nil && info != nil && !info.IsDir() { - if len(osArgs) > 2 { - osArgs = osArgs[2:] - } + osArgs = osArgs[2:] path = file cmd = filepath.Base(file)