Moved code to prepare and provision git and ssh into seperate classes
[vagrant-dotfiles.git] / lib / copy_my_conf / git.rb
diff --git a/lib/copy_my_conf/git.rb b/lib/copy_my_conf/git.rb
new file mode 100644 (file)
index 0000000..eea3b86
--- /dev/null
@@ -0,0 +1,18 @@
+module Vagrant
+  module Provisioners
+    class CopyMyConf < Base
+      class Git
+        def prepare vm, tmp_root
+          `mkdir -p #{tmp_root}/git`
+          `cp ~/.gitconfig #{tmp_root}/git/`
+          vm.share_folder("git", "#{tmp_root}/git/", "#{tmp_root}/git")
+        end
+
+        def provision channel, user_home, tmp_root
+          puts "Copying your gitconfig"
+          channel.execute("cp #{tmp_root}/git/.gitconfig #{user_home}")
+        end
+      end
+    end
+  end
+end
\ No newline at end of file