CWL: Remove space between parameters
1
0
Entering edit mode
7.0 years ago

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.7k views
ADD COMMENT
2
Entering edit mode
7.0 years ago

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 COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 2850 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6