Sha256: 6ac7e30586eae14e36dd7bac4c4820dc30ad2630df4ff4200185a038a7055045
Contents?: true
Size: 648 Bytes
Versions: 10
Compression:
Stored size: 648 Bytes
Contents
require 'shellwords' require 'chake/config' module Chake class ConfigManager class Shell < ConfigManager def converge commands = node.data['shell'].join(' && ') node.run_as_root sh(commands) end def apply(config) node.run_as_root sh(config) end def self.accept?(node) node.data.key?('shell') end private def sh(command) if node.path command = "cd #{node.path} && " + command end if node.silent "sh -ec '#{command}' >/dev/null" else "sh -xec '#{command}'" end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems