Skip to content

Commit a0fcc7b

Browse files
abhi18avpditommaso
authored andcommitted
Fix chmod command to accommodate hidden files in bindir (or empty bindir) (#3247)
Signed-off-by: Paolo Di Tommaso <[email protected]>
1 parent 021d898 commit a0fcc7b

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

plugins/nf-amazon/src/main/nextflow/cloud/aws/batch/AwsBatchFileCopyStrategy.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class AwsBatchFileCopyStrategy extends SimpleFileCopyStrategy {
7171
// when a remote bin directory is provide managed it properly
7272
if( opts.remoteBinDir ) {
7373
result << "${opts.getAwsCli()} s3 cp --recursive --only-show-errors s3:/${opts.remoteBinDir} \$PWD/nextflow-bin\n"
74-
result << "chmod +x \$PWD/nextflow-bin/*\n"
74+
result << "chmod +x \$PWD/nextflow-bin/* || true\n"
7575
result << "export PATH=\$PWD/nextflow-bin:\$PATH\n"
7676
}
7777
// finally render the environment

plugins/nf-amazon/src/test/nextflow/cloud/aws/batch/AwsBatchFileCopyStrategyTest.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ class AwsBatchFileCopyStrategyTest extends Specification {
326326
opts.getAwsCli() >> 'aws'
327327
script == '''
328328
aws s3 cp --recursive --only-show-errors s3://foo/bar $PWD/nextflow-bin
329-
chmod +x $PWD/nextflow-bin/*
329+
chmod +x $PWD/nextflow-bin/* || true
330330
export PATH=$PWD/nextflow-bin:$PATH
331331
export BAR="world"
332332
export FOO="hola"
@@ -339,7 +339,7 @@ class AwsBatchFileCopyStrategyTest extends Specification {
339339
opts.getRemoteBinDir() >> '/foo/bar'
340340
script == '''
341341
/conda/bin/aws s3 cp --recursive --only-show-errors s3://foo/bar $PWD/nextflow-bin
342-
chmod +x $PWD/nextflow-bin/*
342+
chmod +x $PWD/nextflow-bin/* || true
343343
export PATH=$PWD/nextflow-bin:$PATH
344344
export BAR="world"
345345
export FOO="hola"
@@ -353,7 +353,7 @@ class AwsBatchFileCopyStrategyTest extends Specification {
353353
opts.getRegion() >> 'eu-west-1'
354354
script == '''
355355
/conda/bin/aws s3 cp --recursive --only-show-errors s3://foo/bar $PWD/nextflow-bin
356-
chmod +x $PWD/nextflow-bin/*
356+
chmod +x $PWD/nextflow-bin/* || true
357357
export PATH=$PWD/nextflow-bin:$PATH
358358
export BAR="world"
359359
export FOO="hola"

plugins/nf-amazon/src/test/nextflow/cloud/aws/batch/AwsBatchScriptLauncherTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class AwsBatchScriptLauncherTest extends Specification {
159159
then:
160160
binding.task_env == '''\
161161
aws s3 cp --recursive --only-show-errors s3://bucket/bin $PWD/nextflow-bin
162-
chmod +x $PWD/nextflow-bin/*
162+
chmod +x $PWD/nextflow-bin/* || true
163163
export PATH=$PWD/nextflow-bin:$PATH
164164
export FOO="xxx"
165165
'''.stripIndent()

plugins/nf-azure/src/main/nextflow/cloud/azure/batch/AzFileCopyStrategy.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class AzFileCopyStrategy extends SimpleFileCopyStrategy {
8787
String getStageInputFilesScript(Map<String, Path> inputFiles) {
8888
String result = ( remoteBinDir ? """\
8989
nxf_az_download '${AzHelper.toHttpUrl(remoteBinDir)}' \$PWD/.nextflow-bin
90-
chmod +x \$PWD/.nextflow-bin/*
90+
chmod +x \$PWD/.nextflow-bin/* || true
9191
""".stripIndent() : '' )
9292

9393
result += 'downloads=(true)\n'

plugins/nf-azure/src/test/nextflow/cloud/azure/batch/AzFileCopyStrategyTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ class AzFileCopyStrategyTest extends Specification {
216216
binding.stage_inputs == '''\
217217
# stage input files
218218
nxf_az_download 'http://account.blob.core.windows.net/my-data/work/remote/bin' $PWD/.nextflow-bin
219-
chmod +x $PWD/.nextflow-bin/*
219+
chmod +x $PWD/.nextflow-bin/* || true
220220
downloads=(true)
221221
222222
nxf_parallel "${downloads[@]}"

plugins/nf-google/src/main/nextflow/cloud/google/lifesciences/GoogleLifeSciencesFileCopyStrategy.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class GoogleLifeSciencesFileCopyStrategy extends SimpleFileCopyStrategy {
155155
copy.remove('PATH')
156156
// when a remote bin directory is provide managed it properly
157157
if( config.remoteBinDir ) {
158-
result << "chmod +x $localTaskDir/nextflow-bin/*\n"
158+
result << "chmod +x $localTaskDir/nextflow-bin/* || true\n"
159159
result << "export PATH=$localTaskDir/nextflow-bin:\$PATH\n"
160160
}
161161
// finally render the environment

plugins/nf-google/src/test/nextflow/cloud/google/lifesciences/GoogleLifeSciencesFileCopyStrategyTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ class GoogleLifeSciencesFileCopyStrategyTest extends GoogleSpecification {
219219
def envScript = strategy.getEnvScript([FOO:1, BAR: 2, PATH: 3], false)
220220
then:
221221
envScript == '''\
222-
chmod +x /work/xx/yy/nextflow-bin/*
222+
chmod +x /work/xx/yy/nextflow-bin/* || true
223223
export PATH=/work/xx/yy/nextflow-bin:$PATH
224224
export BAR="2"
225225
export FOO="1"

plugins/nf-google/src/test/nextflow/cloud/google/lifesciences/GoogleLifeSciencesScriptLauncherTest.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class GoogleLifeSciencesScriptLauncherTest extends GoogleSpecification {
5656
binding.stage_cmd == null
5757
binding.unstage_cmd == null
5858
binding.task_env == '''\
59-
chmod +x /work/xx/yy/nextflow-bin/*
59+
chmod +x /work/xx/yy/nextflow-bin/* || true
6060
export PATH=/work/xx/yy/nextflow-bin:$PATH
6161
export FOO="xxx"
6262
'''.stripIndent()

0 commit comments

Comments
 (0)