Skip to content

Commit

Permalink
Fix chmod command to accommodate hidden files in bindir (or empty bin…
Browse files Browse the repository at this point in the history
…dir) (#3247)

Signed-off-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
abhi18av authored and pditommaso committed Sep 27, 2022
1 parent 021d898 commit 01eacf3
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class AwsBatchFileCopyStrategy extends SimpleFileCopyStrategy {
// when a remote bin directory is provide managed it properly
if( opts.remoteBinDir ) {
result << "${opts.getAwsCli()} s3 cp --recursive --only-show-errors s3:/${opts.remoteBinDir} \$PWD/nextflow-bin\n"
result << "chmod +x \$PWD/nextflow-bin/*\n"
result << "chmod +x \$PWD/nextflow-bin/* || true\n"
result << "export PATH=\$PWD/nextflow-bin:\$PATH\n"
}
// finally render the environment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class AwsBatchFileCopyStrategyTest extends Specification {
opts.getAwsCli() >> 'aws'
script == '''
aws s3 cp --recursive --only-show-errors s3://foo/bar $PWD/nextflow-bin
chmod +x $PWD/nextflow-bin/*
chmod +x $PWD/nextflow-bin/* || true
export PATH=$PWD/nextflow-bin:$PATH
export BAR="world"
export FOO="hola"
Expand All @@ -339,7 +339,7 @@ class AwsBatchFileCopyStrategyTest extends Specification {
opts.getRemoteBinDir() >> '/foo/bar'
script == '''
/conda/bin/aws s3 cp --recursive --only-show-errors s3://foo/bar $PWD/nextflow-bin
chmod +x $PWD/nextflow-bin/*
chmod +x $PWD/nextflow-bin/* || true
export PATH=$PWD/nextflow-bin:$PATH
export BAR="world"
export FOO="hola"
Expand All @@ -353,7 +353,7 @@ class AwsBatchFileCopyStrategyTest extends Specification {
opts.getRegion() >> 'eu-west-1'
script == '''
/conda/bin/aws s3 cp --recursive --only-show-errors s3://foo/bar $PWD/nextflow-bin
chmod +x $PWD/nextflow-bin/*
chmod +x $PWD/nextflow-bin/* || true
export PATH=$PWD/nextflow-bin:$PATH
export BAR="world"
export FOO="hola"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class AwsBatchScriptLauncherTest extends Specification {
then:
binding.task_env == '''\
aws s3 cp --recursive --only-show-errors s3://bucket/bin $PWD/nextflow-bin
chmod +x $PWD/nextflow-bin/*
chmod +x $PWD/nextflow-bin/* || true
export PATH=$PWD/nextflow-bin:$PATH
export FOO="xxx"
'''.stripIndent()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class AzFileCopyStrategy extends SimpleFileCopyStrategy {
String getStageInputFilesScript(Map<String, Path> inputFiles) {
String result = ( remoteBinDir ? """\
nxf_az_download '${AzHelper.toHttpUrl(remoteBinDir)}' \$PWD/.nextflow-bin
chmod +x \$PWD/.nextflow-bin/*
chmod +x \$PWD/.nextflow-bin/* || true
""".stripIndent() : '' )

result += 'downloads=(true)\n'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class AzFileCopyStrategyTest extends Specification {
binding.stage_inputs == '''\
# stage input files
nxf_az_download 'http://account.blob.core.windows.net/my-data/work/remote/bin' $PWD/.nextflow-bin
chmod +x $PWD/.nextflow-bin/*
chmod +x $PWD/.nextflow-bin/* || true
downloads=(true)
nxf_parallel "${downloads[@]}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class GoogleLifeSciencesFileCopyStrategyTest extends GoogleSpecification {
def envScript = strategy.getEnvScript([FOO:1, BAR: 2, PATH: 3], false)
then:
envScript == '''\
chmod +x /work/xx/yy/nextflow-bin/*
chmod +x /work/xx/yy/nextflow-bin/* || true
export PATH=/work/xx/yy/nextflow-bin:$PATH
export BAR="2"
export FOO="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class GoogleLifeSciencesScriptLauncherTest extends GoogleSpecification {
binding.stage_cmd == null
binding.unstage_cmd == null
binding.task_env == '''\
chmod +x /work/xx/yy/nextflow-bin/*
chmod +x /work/xx/yy/nextflow-bin/* || true
export PATH=/work/xx/yy/nextflow-bin:$PATH
export FOO="xxx"
'''.stripIndent()
Expand Down

0 comments on commit 01eacf3

Please sign in to comment.