Question: CWL: Remove space between parameters
0
gravatar for kevin.o.oluoch
2.6 years ago by
Kenya
kevin.o.oluoch70 wrote:

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 • 808 views
ADD COMMENTlink modified 2.5 years ago by Michael R. Crusoe1.8k • written 2.6 years ago by kevin.o.oluoch70
2
gravatar for Michael R. Crusoe
2.5 years ago by
Common Workflow Language project
Michael R. Crusoe1.8k wrote:

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!

ADD COMMENTlink modified 2.5 years ago • written 2.5 years ago by Michael R. Crusoe1.8k

Hi Michael R. Crusoe,

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

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

Kindly help.

ADD REPLYlink written 2.5 years ago by kevin.o.oluoch70

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

ADD REPLYlink modified 2.5 years ago • written 2.5 years ago by Michael R. Crusoe1.8k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2026 users visited in the last hour