lib/sushi_fabric/sushiApp.rb in sushi_fabric-0.9.5 vs lib/sushi_fabric/sushiApp.rb in sushi_fabric-0.9.6
- old
+ new
@@ -1,8 +1,8 @@
#!/usr/bin/env ruby
# encoding: utf-8
-# Version = '20191219-104017'
+# Version = '20200409-110502'
require 'csv'
require 'fileutils'
require 'yaml'
require 'drb/drb'
@@ -389,12 +389,17 @@
FileUtils.mkdir_p(@scratch_result_dir)
FileUtils.mkdir_p(@job_script_dir)
end
def check_latest_module_version(mod)
command_out = %x[ bash -lc "source #{@module_source}; module whatis #{mod} 2>&1" ]
- latest_mod = command_out.split.first
- latest_mod = nil if latest_mod == "Failed"
+ latest_mod = nil
+ command_out.split("\n").each do |line|
+ if line =~ /#{mod}/
+ latest_mod = line.split.first
+ break
+ end
+ end
latest_mod
end
def job_header
@scratch_dir = if @params['process_mode'] == 'SAMPLE'
@scratch_result_dir + "_" + @dataset['Name'] + '_temp$$'
@@ -414,10 +419,9 @@
end
module_add_commands = if @modules and !@modules.empty?
modules_with_version = @modules.map{|mod| check_latest_module_version(mod)}
modules_with_version.compact!
"module add #{modules_with_version.join(' ')}"
- #"module add #{@modules.join(' ')}"
else
""
end
@out.print <<-EOF
#!/bin/bash