1/* 2Copyright The Helm Authors. 3Licensed under the Apache License, Version 2.0 (the "License"); 4you may not use this file except in compliance with the License. 5You may obtain a copy of the License at 6 7http://www.apache.org/licenses/LICENSE-2.0 8 9Unless required by applicable law or agreed to in writing, software 10distributed under the License is distributed on an "AS IS" BASIS, 11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12See the License for the specific language governing permissions and 13limitations under the License. 14*/ 15 16package installer // import "helm.sh/helm/v3/pkg/plugin/installer" 17 18import ( 19 "path/filepath" 20 21 "helm.sh/helm/v3/pkg/helmpath" 22) 23 24type base struct { 25 // Source is the reference to a plugin 26 Source string 27} 28 29func newBase(source string) base { 30 return base{source} 31} 32 33// Path is where the plugin will be installed. 34func (b *base) Path() string { 35 if b.Source == "" { 36 return "" 37 } 38 return helmpath.DataPath("plugins", filepath.Base(b.Source)) 39} 40