Sha256: 2c8e1581541cfd03f9885a9fad237ac220a235669a763acd1d154eec16b1bb77
Contents?: true
Size: 733 Bytes
Versions: 8
Compression:
Stored size: 733 Bytes
Contents
module Flay::Helpers def metadata_path return nil if git_root.nil? File.join(git_root, "metadata.rb") end def git_root @git_root ||= begin output, _, status = shell_exec("git rev-parse --show-toplevel", show_output: false) return nil unless status == 0 output.chomp end end def shell_exec(command, show_output: true) output, error, status = Open3.capture3(command) if show_output say output say error, :red unless status == 0 end [output, error, status] end def shell_exec_quiet(command, error_message: nil) status = shell_exec(command, show_output: false).last say error_message, :red if error_message && status != 0 status == 0 end end
Version data entries
8 entries across 8 versions & 1 rubygems