Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2815 from lucab/to-upstream/multicall-strip-path
Browse files Browse the repository at this point in the history
pkg/multicall: strip path from command before matching
  • Loading branch information
tmrts committed Jun 21, 2016
2 parents f4f5380 + 9b442ef commit af7ffb3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/multicall/multicall.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"fmt"
"os"
"os/exec"
"path"
"syscall"
)

Expand Down Expand Up @@ -62,7 +63,7 @@ func Add(name string, fn commandFn) Entrypoint {
// exit with an exit status of 1, otherwise it will exit with a 0 exit
// status.
func MaybeExec() {
name := os.Args[0]
name := path.Base(os.Args[0])
if fn, ok := commands[name]; ok {
if err := fn(); err != nil {
fmt.Fprintln(os.Stderr, err)
Expand Down

0 comments on commit af7ffb3

Please sign in to comment.