From 793d0b609e23783d8a78d835f987c3bd9307dbaa Mon Sep 17 00:00:00 2001 From: yahavi Date: Thu, 17 Aug 2023 19:17:01 +0300 Subject: [PATCH] Transfer plugin install - trim the input JFrog home path --- .../commands/transferinstall/datatransferinstall.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/artifactory/commands/transferinstall/datatransferinstall.go b/artifactory/commands/transferinstall/datatransferinstall.go index ee5c7a8cc..0c4ac6371 100644 --- a/artifactory/commands/transferinstall/datatransferinstall.go +++ b/artifactory/commands/transferinstall/datatransferinstall.go @@ -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 { @@ -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 } }