Skip to content

Commit

Permalink
fix the check for changed 'allowexisitingsourcefolder' flag, fix syml…
Browse files Browse the repository at this point in the history
…ink handler
  • Loading branch information
consolethinks committed Aug 27, 2024
1 parent 62fda76 commit 8e35da7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cmd/commands/datasetIngestor.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ For Windows you need instead to specify -user username:password on the command l
}
color.Unset()
if !allowExistingSourceFolder && len(foundList) > 0 {
if cmd.Flags().Changed("allowexistingsource") {
if !cmd.Flags().Changed("allowexistingsource") {
log.Printf("Do you want to ingest the corresponding new datasets nevertheless (y/N) ? ")
scanner.Scan()
archiveAgain := scanner.Text()
Expand Down Expand Up @@ -498,20 +498,18 @@ func createLocalSymlinkCallbackForFileLister(skipSymlinks *string, skippedLinks
keep := true
pointee, _ := os.Readlink(symlinkPath) // just pass the file name
if !filepath.IsAbs(pointee) {
dir, err := filepath.Abs(filepath.Dir(symlinkPath))
symlinkAbs, err := filepath.Abs(filepath.Dir(symlinkPath))
if err != nil {
return false, err
}
// log.Printf(" CWD path pointee :%v %v %v", dir, filepath.Dir(path), pointee)
pabs := filepath.Join(dir, filepath.Dir(symlinkPath), pointee)
pointee, err = filepath.EvalSymlinks(pabs)
pointeeAbs := filepath.Join(symlinkAbs, pointee)
pointee, err = filepath.EvalSymlinks(pointeeAbs)
if err != nil {
log.Printf("Could not follow symlink for file:%v %v", pabs, err)
log.Printf("Could not follow symlink for file:%v %v", pointeeAbs, err)
keep = false
log.Printf("keep variable set to %v", keep)
}
}
//fmt.Printf("Skip variable:%v\n", *skip)
if *skipSymlinks == "ka" || *skipSymlinks == "kA" {
keep = true
} else if *skipSymlinks == "sa" || *skipSymlinks == "sA" {
Expand Down

0 comments on commit 8e35da7

Please sign in to comment.