Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

fix gf install command path id column output is not continuous. #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions command/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ func checkPathAndAppendToInstallFolderPath(folderPaths []installFolderPath, path
if !writable && !installed {
return folderPaths
}
// Ignore appended path.
if isAppended(folderPaths, path) {
return folderPaths
}
return append(
folderPaths,
installFolderPath{
Expand All @@ -204,3 +208,13 @@ func checkPathAndAppendToInstallFolderPath(folderPaths []installFolderPath, path
func isInstalled(path string) bool {
return gfile.Exists(path)
}

// Check if this gf binary path appended.
func isAppended(folderPaths []installFolderPath, path string) bool {
for _, folderPath := range folderPaths {
if folderPath.path == path {
return true
}
}
return false
}