lib/rbbt/util/cmd.rb in rbbt-util-5.31.9 vs lib/rbbt/util/cmd.rb in rbbt-util-5.31.10

- old
+ new

@@ -8,9 +8,17 @@ TOOLS = IndiferentHash.setup({}) def self.tool(tool, claim = nil, test = nil, cmd = nil, &block) TOOLS[tool] = [claim, test, block, cmd] end + def self.conda(tool, env = nil, channel = 'bioconda') + if env + CMD.cmd("bash -l -c '(conda activate #{env} && conda install #{tool} -c #{channel})'") + else + CMD.cmd("bash -l -c 'conda install #{tool} -c #{channel}'") + end + end + def self.get_tool(tool) return tool.to_s unless TOOLS[tool] @@init_cmd_tool ||= IndiferentHash.setup({}) if !@@init_cmd_tool[tool]