Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
1512a332
Commit
1512a332
authored
Mar 16, 2017
by
Adam Reese
Committed by
GitHub
Mar 16, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2123 from adamreese/ref/helmpath
ref(helmpath): simplify path building of helmpath
parents
609276d9
390217d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
9 deletions
+17
-9
helmhome.go
pkg/helm/helmpath/helmhome.go
+17
-9
No files found.
pkg/helm/helmpath/helmhome.go
View file @
1512a332
...
@@ -32,30 +32,37 @@ func (h Home) String() string {
...
@@ -32,30 +32,37 @@ func (h Home) String() string {
return
string
(
h
)
return
string
(
h
)
}
}
// Path returns Home with elements appended.
func
(
h
Home
)
Path
(
elem
...
string
)
string
{
p
:=
[]
string
{
string
(
h
)}
p
=
append
(
p
,
elem
...
)
return
filepath
.
Join
(
p
...
)
}
// Repository returns the path to the local repository.
// Repository returns the path to the local repository.
func
(
h
Home
)
Repository
()
string
{
func
(
h
Home
)
Repository
()
string
{
return
filepath
.
Join
(
string
(
h
),
"repository"
)
return
h
.
Path
(
"repository"
)
}
}
// RepositoryFile returns the path to the repositories.yaml file.
// RepositoryFile returns the path to the repositories.yaml file.
func
(
h
Home
)
RepositoryFile
()
string
{
func
(
h
Home
)
RepositoryFile
()
string
{
return
filepath
.
Join
(
string
(
h
),
"repository/
repositories.yaml"
)
return
h
.
Path
(
"repository"
,
"
repositories.yaml"
)
}
}
// Cache returns the path to the local cache.
// Cache returns the path to the local cache.
func
(
h
Home
)
Cache
()
string
{
func
(
h
Home
)
Cache
()
string
{
return
filepath
.
Join
(
string
(
h
),
"repository/
cache"
)
return
h
.
Path
(
"repository"
,
"
cache"
)
}
}
// CacheIndex returns the path to an index for the given named repository.
// CacheIndex returns the path to an index for the given named repository.
func
(
h
Home
)
CacheIndex
(
name
string
)
string
{
func
(
h
Home
)
CacheIndex
(
name
string
)
string
{
target
:=
fmt
.
Sprintf
(
"repository/cache/%s-index.yaml"
,
name
)
target
:=
fmt
.
Sprintf
(
"repository/cache/%s-index.yaml"
,
name
)
return
filepath
.
Join
(
string
(
h
),
target
)
return
h
.
Path
(
target
)
}
}
// Starters returns the path to the Helm starter packs.
// Starters returns the path to the Helm starter packs.
func
(
h
Home
)
Starters
()
string
{
func
(
h
Home
)
Starters
()
string
{
return
filepath
.
Join
(
string
(
h
),
"starters"
)
return
h
.
Path
(
"starters"
)
}
}
// LocalRepository returns the location to the local repo.
// LocalRepository returns the location to the local repo.
...
@@ -63,12 +70,13 @@ func (h Home) Starters() string {
...
@@ -63,12 +70,13 @@ func (h Home) Starters() string {
// The local repo is the one used by 'helm serve'
// The local repo is the one used by 'helm serve'
//
//
// If additional path elements are passed, they are appended to the returned path.
// If additional path elements are passed, they are appended to the returned path.
func
(
h
Home
)
LocalRepository
(
paths
...
string
)
string
{
func
(
h
Home
)
LocalRepository
(
elem
...
string
)
string
{
frag
:=
append
([]
string
{
string
(
h
),
"repository/local"
},
paths
...
)
p
:=
[]
string
{
"repository"
,
"local"
}
return
filepath
.
Join
(
frag
...
)
p
=
append
(
p
,
elem
...
)
return
h
.
Path
(
p
...
)
}
}
// Plugins returns the path to the plugins directory.
// Plugins returns the path to the plugins directory.
func
(
h
Home
)
Plugins
()
string
{
func
(
h
Home
)
Plugins
()
string
{
return
filepath
.
Join
(
string
(
h
),
"plugins"
)
return
h
.
Path
(
"plugins"
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment