diff --git a/command/install/install.go b/command/install/install.go index 2bd3035..0afdedd 100644 --- a/command/install/install.go +++ b/command/install/install.go @@ -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{ @@ -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 +}