mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 01:50:55 +00:00
Define a plugin compiler.
This commit is contained in:
@@ -34,12 +34,12 @@ func ConfigRoot() string {
|
||||
dir := os.Getenv(XDG_CONFIG_HOME)
|
||||
if len(dir) == 0 {
|
||||
dir = filepath.Join(
|
||||
homeDir(), defaultConfigSubdir)
|
||||
HomeDir(), defaultConfigSubdir)
|
||||
}
|
||||
return filepath.Join(dir, PgmName)
|
||||
return filepath.Join(dir, ProgramName)
|
||||
}
|
||||
|
||||
func homeDir() string {
|
||||
func HomeDir() string {
|
||||
home := os.Getenv(homeEnv())
|
||||
if len(home) > 0 {
|
||||
return home
|
||||
|
||||
@@ -34,7 +34,7 @@ func TestConfigDirNoXdg(t *testing.T) {
|
||||
}
|
||||
if !strings.HasSuffix(
|
||||
s,
|
||||
rootedPath(defaultConfigSubdir, PgmName)) {
|
||||
rootedPath(defaultConfigSubdir, ProgramName)) {
|
||||
t.Fatalf("unexpected config dir: %s", s)
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ func TestConfigDirWithXdg(t *testing.T) {
|
||||
if isSet {
|
||||
os.Setenv(XDG_CONFIG_HOME, xdg)
|
||||
}
|
||||
if s != rootedPath("blah", PgmName) {
|
||||
if s != rootedPath("blah", ProgramName) {
|
||||
t.Fatalf("unexpected config dir: %s", s)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,9 @@ var KustomizationFileNames = []string{
|
||||
}
|
||||
|
||||
const (
|
||||
PgmName = "kustomize"
|
||||
Repo = "sigs.k8s.io"
|
||||
// Program name, for help, finding the XDG_CONFIG_DIR, etc.
|
||||
ProgramName = "kustomize"
|
||||
// Domain from which kustomize code is imported, for locating
|
||||
// plugin source code under $GOPATH.
|
||||
DomainName = "sigs.k8s.io"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user