This is a test version of Biostars. For the public version, visit https://www.biostars.org.
CWL: Remove space between parameters

I want to create a directory and sub-directory from two input parameters. I want the command on the terminal to be

mkdir -p DIRECTORY/SUBDIRECTORY

How do I remove space between parameters in common workflow language?

My current code is:

#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool


inputs:
  DIRECTORY:
    type: string
    inputBinding:
      prefix: -p
      separate: false
      position: 1
  SUBDIRECTORY:
    type: string
    inputBinding:
      prefix: /
      separate: false
      position: 2

outputs: []

baseCommand: mkdir
cwl

1 answer

Hello kevin.o.oluoch,

You have a couple options. Here is how I would do it (though I've never come across a reason to make an empty directory with a subdirecto

#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool

inputs:
  DIRECTORY: string
  SUBDIRECTORY: string

outputs:
  new_directory_with_subdirectory:
    type: Directory
    outputBinding:
      glob: $(inputs.DIRECTORY)

baseCommand: mkdir

arguments:
  - valueFrom: $(inputs.DIRECTORY)/$(inputs.SUBDIRECTORY)
    prefix: -p

Hope this helps!

Hi Michael R. Crusoe,

I've tried running it but i get the following error:

:1:1: Expression evaluation error: DIRECTORY'DIRECTORY'

Kindly help.

Whoops, I didn't test the code. I added the missing inputs. to the $(…) references and the missing s to arguments.

Log in to answer this question.