Skip to content

Commit

Permalink
Implement Changit.run; system modules wrapper
Browse files Browse the repository at this point in the history
Use it inside bin/changit to run the program
  • Loading branch information
aonemd committed Nov 28, 2016
1 parent 683cf5e commit a48d4c6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 1 addition & 2 deletions bin/changit
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@

require 'changit'

initial = Changit::Initial.new
initial.hello
Changit.run
16 changes: 12 additions & 4 deletions lib/changit.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
require 'changit/version'
require 'changit/git_dir_finder'
require 'changit/config_reader'
require 'changit/config_writer'

module Changit
class Initial
def hello
puts 'Hello vvorld'
end
def self.run
# File to copy from
config = ConfigReader.new.read

# First, search directories inside the current pwd and make sure they contain a .git dir
files_to_write_to = GitDirFinder.new.find_all

# Then, copy the gitconfig file content to each .git/config file in these directories
ConfigWriter.new(config, files_to_write_to).write
end
end

0 comments on commit a48d4c6

Please sign in to comment.