diff --git a/cmd/commands/datasetIngestor.go b/cmd/commands/datasetIngestor.go index ec1eee2..6f95946 100644 --- a/cmd/commands/datasetIngestor.go +++ b/cmd/commands/datasetIngestor.go @@ -93,30 +93,31 @@ For Windows you need instead to specify -user username:password on the command l var globusClient globus.GlobusClient var gConfig cliutils.GlobusConfig - switch transferType { - case Ssh: - transferFiles = cliutils.SshTransfer - case Globus: - transferFiles = cliutils.GlobusTransfer - var globusConfigPath string - if cmd.Flags().Lookup("globus-cfg").Changed { - globusConfigPath = globusCfgFlag - } else { - execPath, err := os.Executable() - if err != nil { - log.Fatalln("can't find executable path:", err) + if copyFlag { + switch transferType { + case Ssh: + transferFiles = cliutils.SshTransfer + case Globus: + transferFiles = cliutils.GlobusTransfer + var globusConfigPath string + if cmd.Flags().Lookup("globus-cfg").Changed { + globusConfigPath = globusCfgFlag + } else { + execPath, err := os.Executable() + if err != nil { + log.Fatalln("can't find executable path:", err) + } + globusConfigPath = filepath.Join(filepath.Dir(execPath), "globus.yaml") } - globusConfigPath = filepath.Join(filepath.Dir(execPath), "globus.yaml") - } - globusClient, gConfig, err = cliutils.GlobusLogin(globusConfigPath) - if err != nil { - log.Fatalln("couldn't create globus client:", err) - } + globusClient, gConfig, err = cliutils.GlobusLogin(globusConfigPath) + if err != nil { + log.Fatalln("couldn't create globus client:", err) + } - if autoarchiveFlag { - log.Println("Cannot autoarchive when transferring via Globus due to the transfer happening asynchronously. Use the \"globusCheckTransfer\" command to archive them") - autoarchiveFlag = false + if autoarchiveFlag { + log.Fatalln("Cannot autoarchive when transferring via Globus due to the transfer happening asynchronously. Use the \"globusCheckTransfer\" command to archive them") + } } }