File tree Expand file tree Collapse file tree 2 files changed +15
-14
lines changed
main/nextflow/cloud/azure/file
test/nextflow/cloud/azure/batch Expand file tree Collapse file tree 2 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -70,29 +70,29 @@ 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 --output-level quiet "$name" "$target/$name?$AZ_SAS" --block-blob-tier $AZCOPY_BLOCK_BLOB_TIER --block-size-mb $AZCOPY_BLOCK_SIZE_MB
73
+ azcopy cp "$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
81
mkdir -p "$basedir"
82
-
82
+
83
83
# Try to download as file first, let azcopy handle the detection
84
- if ! azcopy cp --output-level quiet "$source?$AZ_SAS" "$target"; then
84
+ if ! azcopy cp "$source?$AZ_SAS" "$target"; then
85
85
# If failed, remove any partial target and try as directory
86
86
rm -rf "$target"
87
87
mkdir -p "$target"
88
- if ! azcopy cp --output-level quiet "$source/*?$AZ_SAS" "$target" --recursive; then
88
+ if ! azcopy cp "$source/*?$AZ_SAS" "$target" --recursive; then
89
89
rm -rf "$target"
90
90
>&2 echo "Unable to download path: $source"
91
91
exit 1
92
92
fi
93
93
fi
94
94
}
95
- ''' . stripIndent(true )
95
+ ''' . stripIndent()
96
96
}
97
97
98
98
String render () {
Original file line number Diff line number Diff line change @@ -179,18 +179,19 @@ class AzFileCopyStrategyTest extends Specification {
179
179
local source=$1
180
180
local target=$2
181
181
local basedir=$(dirname $2)
182
- local ret
183
182
mkdir -p "$basedir"
184
183
185
- ret=$(azcopy cp "$source?$AZ_SAS" "$target" 2>&1) || {
186
- ## if fails check if it was trying to download a directory
187
- mkdir -p $target
188
- azcopy cp "$source/*?$AZ_SAS" "$target" --recursive >/dev/null || {
189
- rm -rf $target
184
+ # Try to download as file first, let azcopy handle the detection
185
+ if ! azcopy cp "$source?$AZ_SAS" "$target"; then
186
+ # If failed, remove any partial target and try as directory
187
+ rm -rf "$target"
188
+ mkdir -p "$target"
189
+ if ! azcopy cp "$source/*?$AZ_SAS" "$target" --recursive; then
190
+ rm -rf "$target"
190
191
>&2 echo "Unable to download path: $source"
191
192
exit 1
192
- }
193
- }
193
+ fi
194
+ fi
194
195
}
195
196
196
197
''' . stripIndent(true )
You can’t perform that action at this time.
0 commit comments