blob: 8d7993a9add65eb7e09d697bb1c4c440d077a3c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package env
import (
"os"
)
// This package encapsulates accessing/mutating the ENV of the program.
func GetGitDirEnv() string {
return os.Getenv("GIT_DIR")
}
func GetGitWorkTreeEnv() string {
return os.Getenv("GIT_WORK_TREE")
}
func SetGitDirEnv(value string) {
os.Setenv("GIT_DIR", value)
}
func SetGitWorkTreeEnv(value string) {
os.Setenv("GIT_WORK_TREE", value)
}
func UnsetGitDirEnvs() {
_ = os.Unsetenv("GIT_DIR")
_ = os.Unsetenv("GIT_WORK_TREE")
}
|