mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-13 09:57:51 +08:00
Replace "PATHEXT" literals with a constant
This commit is contained in:
parent
b2c7746bf6
commit
b9d515dd78
|
@ -80,10 +80,9 @@ func TestMakeHasCommand(t *testing.T) {
|
|||
oldPath := os.Getenv(util.EnvPATH)
|
||||
defer os.Setenv(util.EnvPATH, oldPath)
|
||||
if runtime.GOOS == "windows" {
|
||||
oldPathExt := os.Getenv("PATHEXT")
|
||||
defer os.Setenv("PATHEXT", oldPathExt)
|
||||
// Forces default value
|
||||
os.Setenv("PATHEXT", "")
|
||||
oldPathExt := os.Getenv(util.EnvPATHEXT)
|
||||
defer os.Setenv(util.EnvPATHEXT, oldPathExt)
|
||||
os.Unsetenv(util.EnvPATHEXT) // force default value
|
||||
}
|
||||
|
||||
// Set up a directory in PATH.
|
||||
|
|
|
@ -2,9 +2,13 @@
|
|||
package util
|
||||
|
||||
// Environment variables with special significance to Elvish.
|
||||
//
|
||||
// Note that some of these env vars may be significant only in special
|
||||
// circumstances; such as when running unit tests.
|
||||
const (
|
||||
EnvHOME = "HOME"
|
||||
EnvPATH = "PATH"
|
||||
EnvPWD = "PWD"
|
||||
EnvSHLVL = "SHLVL"
|
||||
EnvHOME = "HOME"
|
||||
EnvPATH = "PATH"
|
||||
EnvPATHEXT = "PATHEXT"
|
||||
EnvPWD = "PWD"
|
||||
EnvSHLVL = "SHLVL"
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user