Don't add the post_run_command unless the option and a runfolder are specified
[htsworkflow.git] / htsworkflow / pipelines / retrieve_config.py
index 136bb5a50c60ff8890a35b6b579426ca6f593257..f9d4e3ba0df83a4b918a5fafcdc5e5cded75c117 100644 (file)
@@ -148,8 +148,9 @@ def format_gerald_config(options, flowcell_info, genome_map):
         config += ['%s:USE_BASES Y%s' % ( lane_prefix, read_length ) ]
 
     # add in option for running script after 
-    if options.post_run is not None:
-        post_run = options.post_run  % {'runfolder': options.runfolder}
+    if not (options.post_run is None or options.runfolder is None):
+        runfolder = os.path.abspath(options.runfolder)
+        post_run = options.post_run  % {'runfolder': runfolder}
         config += ['POST_RUN_COMMAND %s' % (post_run,) ]
         
     config += [''] # force trailing newline
@@ -203,8 +204,9 @@ Config File:
   Example Config File:
   
     [%s]
-    config_host=http://somewhere.domain:port
-    genome_dir=/path to search for genomes
+    config_host: http://somewhere.domain:port
+    genome_dir: /path to search for genomes
+    post_run: runfolder -o <destdir> %%(runfolder)s
     
 """ % (CONFIG_SYSTEM, CONFIG_USER, GERALD_CONFIG_SECTION)