Skip to content

Commit

Permalink
revert copy condition for transfer configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
consolethinks committed Sep 4, 2024
1 parent 2ff12e4 commit 2552445
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions cmd/commands/datasetIngestor.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,31 +93,29 @@ For Windows you need instead to specify -user username:password on the command l
var globusClient globus.GlobusClient
var gConfig cliutils.GlobusConfig

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")
}

globusClient, gConfig, err = cliutils.GlobusLogin(globusConfigPath)
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("couldn't create globus client:", err)
log.Fatalln("can't find executable path:", err)
}
globusConfigPath = filepath.Join(filepath.Dir(execPath), "globus.yaml")
}

if autoarchiveFlag {
log.Fatalln("Cannot autoarchive when transferring via Globus due to the transfer happening asynchronously. Use the \"globusCheckTransfer\" command to archive them")
}
globusClient, gConfig, err = cliutils.GlobusLogin(globusConfigPath)
if err != nil {
log.Fatalln("couldn't create globus client:", err)
}

if autoarchiveFlag {
log.Fatalln("Cannot autoarchive when transferring via Globus due to the transfer happening asynchronously. Use the \"globusCheckTransfer\" command to archive them")
}
}

Expand Down

0 comments on commit 2552445

Please sign in to comment.