Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let runfiles env vars take priority #2

Merged
merged 1 commit into from
Jan 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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