File: env.go

package info (click to toggle)
lazygit 0.50.0%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,808 kB
  • sloc: sh: 128; makefile: 76
file content (28 lines) | stat: -rw-r--r-- 471 bytes parent folder | download | duplicates (2)
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 SetGitDirEnv(value string) {
	os.Setenv("GIT_DIR", value)
}

func GetWorkTreeEnv() string {
	return os.Getenv("GIT_WORK_TREE")
}

func SetWorkTreeEnv(value string) {
	os.Setenv("GIT_WORK_TREE", value)
}

func UnsetGitLocationEnvVars() {
	_ = os.Unsetenv("GIT_DIR")
	_ = os.Unsetenv("GIT_WORK_TREE")
}