fsx: Remove environment references

This commit removes the reference to the environment from the fsx
package.
This commit is contained in:
Tom Wiesing 2023-03-02 11:47:11 +01:00
parent 5a43ecfaeb
commit 3263920d6b
No known key found for this signature in database
25 changed files with 167 additions and 183 deletions

View file

@ -39,14 +39,14 @@ func (pcfg PathsConfig) UsingDistilleryExecutable(env environment.Environment) b
if err != nil {
return false
}
return fsx.SameFile(env, exe, pcfg.ExecutablePath())
return fsx.SameFile(exe, pcfg.ExecutablePath())
}
// CurrentExecutable returns the path to the current executable being used.
// When it does not exist, falls back to the default executable.
func (pcfg PathsConfig) CurrentExecutable(env environment.Environment) string {
exe, err := os.Executable()
if err != nil || !fsx.IsFile(env, exe) {
if err != nil || !fsx.IsFile(exe) {
return pcfg.ExecutablePath()
}
return exe