File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
plugins/nf-azure/src/main/nextflow/cloud/azure/file Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -70,26 +70,27 @@ class AzBashLib extends BashFunLib<AzBashLib> {
70
70
azcopy cp "$name" "$target/$dir_name?$AZ_SAS" --recursive --block-blob-tier $AZCOPY_BLOCK_BLOB_TIER --block-size-mb $AZCOPY_BLOCK_SIZE_MB
71
71
fi
72
72
else
73
- azcopy cp "$name" "$target/$name?$AZ_SAS" --block-blob-tier $AZCOPY_BLOCK_BLOB_TIER --block-size-mb $AZCOPY_BLOCK_SIZE_MB
73
+ azcopy cp --output-level quiet "$name" "$target/$name?$AZ_SAS" --block-blob-tier $AZCOPY_BLOCK_BLOB_TIER --block-size-mb $AZCOPY_BLOCK_SIZE_MB
74
74
fi
75
75
}
76
76
77
77
nxf_az_download() {
78
78
local source=$1
79
79
local target=$2
80
80
local basedir=$(dirname $2)
81
- local ret
82
81
mkdir -p "$basedir"
83
82
84
- ret=$(azcopy cp "$source?$AZ_SAS" "$target" 2>&1) || {
85
- ## if fails check if it was trying to download a directory
86
- mkdir -p $target
87
- azcopy cp "$source/*?$AZ_SAS" "$target" --recursive >/dev/null || {
88
- rm -rf $target
83
+ # Try to download as file first, let azcopy handle the detection
84
+ if ! azcopy cp --output-level quiet "$source?$AZ_SAS" "$target"; then
85
+ # If failed, remove any partial target and try as directory
86
+ rm -rf "$target"
87
+ mkdir -p "$target"
88
+ if ! azcopy cp --output-level quiet"$source/*?$AZ_SAS" "$target" --recursive; then
89
+ rm -rf "$target"
89
90
>&2 echo "Unable to download path: $source"
90
91
exit 1
91
- }
92
- }
92
+ fi
93
+ fi
93
94
}
94
95
''' . stripIndent(true )
95
96
}
You can’t perform that action at this time.
0 commit comments