Skip to content

Commit

Permalink
Merge pull request #2 from fmeum/use-vars-first
Browse files Browse the repository at this point in the history
Let runfiles env vars take priority
  • Loading branch information
phst authored Jan 17, 2022
2 parents bafe238 + 38845f7 commit f6dd635
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions runfiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ func New(opts ...Option) (*Runfiles, error) {
}
// See section “Runfiles discovery” in
// https://docs.google.com/document/d/e/2PACX-1vSDIrFnFvEYhKsCMdGdD40wZRBX3m3aZ5HhVj4CtHPmiXKDCxioTUbYsDydjKtFDAzER5eg7OjJWs3V/pub.
if o.manifest != "" {
return o.manifest.new()
}
if o.directory != "" {
return o.directory.new(), nil
}
manifest := ManifestFile(o.program + ".runfiles_manifest")
if stat, err := os.Stat(string(manifest)); err == nil && stat.Mode().IsRegular() {
return manifest.new()
Expand All @@ -97,12 +103,6 @@ func New(opts ...Option) (*Runfiles, error) {
if stat, err := os.Stat(string(dir)); err == nil && stat.IsDir() {
return dir.new(), nil
}
if o.manifest != "" {
return o.manifest.new()
}
if o.directory != "" {
return o.directory.new(), nil
}
return nil, errors.New("runfiles: no runfiles found")
}

Expand Down

0 comments on commit f6dd635

Please sign in to comment.