Sha256: 90659f78eb4866545ec6f83a231ca77c7299fdd1e12744bb58bdb42ee57de29b
Contents?: true
Size: 1.43 KB
Versions: 40
Compression:
Stored size: 1.43 KB
Contents
# frozen_string_literal: true require 'avm/git/auto_commit_path' require 'eac_cli/default_runner' module Avm module Tools class Runner < ::EacRubyUtils::Console::DocoptRunner class Git < ::EacRubyUtils::Console::DocoptRunner class AutoCommit < ::EacRubyUtils::Console::DocoptRunner include ::EacCli::DefaultRunner runner_definition do desc 'Commit with message based in content commited.' bool_opt '-d', '--dirty', 'Select dirty files.' pos_arg 'paths', repeat: true, optional: true end def run clear_stage banner run_paths end private def banner infov 'Paths', paths.count end def clear_stage infom 'Clearing stage...' context(:git).system!('reset', 'HEAD') end def dirty_paths return [] unless options.fetch('--dirty') context(:git).dirty_files.map { |d| context(:git).root_path.join / d.path } end def paths_uncached (options.fetch('<paths>') .map { |p| p.to_pathname.expand_path } + dirty_paths) .reject(&:directory?) .sort.uniq.map { |path| ::Avm::Git::AutoCommitPath.new(context(:git), path) } end def run_paths paths.each(&:run) end end end end end end
Version data entries
40 entries across 40 versions & 1 rubygems