Sha256: 4f276b92f957444a340ddc9175b9ca5397f37441d057752e932749896c5050cb
Contents?: true
Size: 1.01 KB
Versions: 3
Compression:
Stored size: 1.01 KB
Contents
require_relative "../../utils/project" require_relative "../../utils/verbose" module DSL def run_script(script, args = {}) items = script.split(" ") if items.size == 1 shell = args[:shell] || ((get(:shell) != "NODATA") ? get(:shell) : nil) script = "#{shell} #{script}" if shell script = "#{script} #{args[:args]} " if args[:args] end items = script.split(" ") if items.size < 1 msg = Rainbow("==> [ERROR] run_script: Incorrect command '#{command}'").red verboseln(msg) return end host = get_host(args[:on]) if host.protocol == "local" items[1] = File.join(Project.value[:project_path], items[1]) command = items.join(" ") run(command, args) elsif host.protocol == "ssh" upload items[1], to: host.id items[1] = File.basename(items[1]) command = items.join(" ") run(command, args) else msg = Rainbow("==> [ERROR] run_script: Incorrect protocol(#{host.protocol})").red verboseln(msg) end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
teuton-2.9.2 | lib/teuton/case/dsl/run_script.rb |
teuton-2.9.1 | lib/teuton/case/dsl/run_script.rb |
teuton-2.9.0 | lib/teuton/case/dsl/run_script.rb |