Created
March 27, 2014 03:43
-
-
Save dtrce/9799692 to your computer and use it in GitHub Desktop.
code climate script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'fileutils' | |
if Dir.exists?(ENV['CODECLIMATE_PATH']) == false | |
abort "CODECLIMATE_PATH variable not set or invalid path" | |
end | |
@cc_path = ENV['CODECLIMATE_PATH'] | |
@repo_name = Dir.pwd.split('/').last | |
@cc_repo_path = "#{@cc_path}/#{@repo_name}" | |
if Dir.exists?("#{@cc_repo_path}") == false | |
Dir.mkdir("#{@cc_repo_path}") | |
end | |
pipe = IO.popen("git ls-files -om --exclude-standard") | |
while (line = pipe.gets) | |
@file = line.strip() | |
if File.exist?(@file) == true | |
FileUtils.cp(@file, @cc_repo_path) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment