Skip to content

Commit

Permalink
Transfer plugin install - trim the input JFrog home path
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi committed Aug 17, 2023
1 parent 5593b81 commit 793d0b6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions artifactory/commands/transferinstall/datatransferinstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,9 @@ func (idtp *InstallDataTransferPluginCommand) getPluginDirDestination() (target

// Flag override
if idtp.localJFrogHomePath != "" {
log.Debug(fmt.Sprintf("Searching for the 'plugins' directory in the JFrog home directory '%s'.", idtp.localJFrogHomePath))
if exists, target, err = idtp.transferManger.findDestination(idtp.localJFrogHomePath); err != nil || exists {
jfrogHomeDir := strings.TrimSpace(idtp.localJFrogHomePath)
log.Debug(fmt.Sprintf("Searching for the 'plugins' directory in the JFrog home directory '%s'.", jfrogHomeDir))
if exists, target, err = idtp.transferManger.findDestination(jfrogHomeDir); err != nil || exists {
return
}
if !exists {
Expand All @@ -227,8 +228,9 @@ func (idtp *InstallDataTransferPluginCommand) getPluginDirDestination() (target
}
// Environment variable override
if envVal, exists = os.LookupEnv(jfrogHomeEnvVar); exists {
log.Debug(fmt.Sprintf("Searching for the 'plugins' directory in the JFrog home directory '%s' retrieved from the '%s' environment variable.", envVal, jfrogHomeEnvVar))
if exists, target, err = idtp.transferManger.findDestination(envVal); err != nil || exists {
jfrogHomeDir := strings.TrimSpace(envVal)
log.Debug(fmt.Sprintf("Searching for the 'plugins' directory in the JFrog home directory '%s' retrieved from the '%s' environment variable.", jfrogHomeDir, jfrogHomeEnvVar))
if exists, target, err = idtp.transferManger.findDestination(jfrogHomeDir); err != nil || exists {
return
}
}
Expand Down

0 comments on commit 793d0b6

Please sign in to comment.