Skip to content

Commit

Permalink
Fix run via shebang to not fail due to redundant/repeated args (#26)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mumoshu committed Sep 15, 2020
1 parent 6137c57 commit 64a0e8b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions variant.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 64a0e8b

Please sign in to comment.