Move home dir logic to package environment

Signed-off-by: Ian Howell <ian.howell0@gmail.com>
pull/5166/head
Ian Howell 7 years ago committed by Alexander Nesterenko
parent 3fecdcfb51
commit e7e99d7cea

@ -17,7 +17,7 @@ limitations under the License.
package main
import (
"k8s.io/helm/pkg/helm/helmpath"
"k8s.io/helm/pkg/helm/environment"
"os"
"testing"
)
@ -32,7 +32,7 @@ func TestRootCmd(t *testing.T) {
{
name: "defaults",
args: "home",
home: helmpath.GetDefaultConfigHome(),
home: environment.GetDefaultConfigHome(),
},
{
name: "with --home set",

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package helmpath
package environment
import (
"github.com/casimir/xdg-go"

@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package helmpath
package environment
import (
"runtime"

@ -48,7 +48,7 @@ func (s *EnvSettings) AddFlags(fs *pflag.FlagSet) {
fs.StringVar(&s.KubeConfig, "kubeconfig", "", "path to the kubeconfig file")
fs.StringVar(&s.KubeContext, "kube-context", "", "name of the kubeconfig context to use")
fs.BoolVar(&s.Debug, "debug", false, "enable verbose output")
fs.StringVar((*string)(&s.Home), "home", helmpath.GetDefaultConfigHome(), "location of your Helm config. Overrides $HELM_HOME")
fs.StringVar((*string)(&s.Home), "home", GetDefaultConfigHome(), "location of your Helm config. Overrides $HELM_HOME")
}
// Init sets values from the environment.

@ -40,8 +40,8 @@ func TestEnvSettings(t *testing.T) {
}{
{
name: "defaults",
home: helmpath.GetDefaultConfigHome(),
plugins: helmpath.Home(helmpath.GetDefaultConfigHome()).Plugins(),
home: GetDefaultConfigHome(),
plugins: helmpath.Home(GetDefaultConfigHome()).Plugins(),
ns: "",
},
{

Loading…
Cancel
Save