Cleanup of the cleanup file

Moved the cleanup to another branch
This commit is contained in:
Samuel Vasko 2013-12-31 15:23:24 +01:00
parent cfa0bc9a26
commit c43ad3cb40
2 changed files with 0 additions and 50 deletions

View File

@ -1,24 +0,0 @@
import os
def main():
cwd = os.getcwd()
os.chdir(cwd + '\\vendor\\msysgit\\libexec\\git-core\\')
for file_ in os.listdir(cwd + '\\vendor\\msysgit\\libexec\\git-core\\'):
if file_ == 'git.exe' or file_ == 'mergetools' or file_.endswith('.bat'):
continue # Ignore main git exe, mergetools folder and already created batch files.
if file_.endswith('.exe'):
with open(os.path.splitext(file_)[0] + '.bat', 'w') as out:
out.write('@ECHO OFF\n' + os.path.splitext(file_)[0].replace('-',' ') + ' $*')
os.remove(file_)
# print 'Cleaned out ' + file_
continue
else:
with open(file_ + '.bat', 'w') as out:
out.write('@ECHO OFF\n' + file_.replace('-', ' ') + ' $*')
os.remove(file_)
# print 'Cleaned out ' + file_
continue
pass
if __name__ == '__main__':
main()

View File

@ -1,26 +0,0 @@
def main()
git_dir = '\\vendor\\msysgit\\libexec\\git-core\\'
working_dir = Dir.pwd
Dir.chdir(working_dir + git_dir)
Dir.entries(working_dir + git_dir).each do |file|
if file == 'git.exe' or file == 'mergetools' or file.end_with?('.bat') then
next
end
if file.end_with?('.exe') then
File.open(File.basename(file, '.*') + '.bat', "w") do |new_file|
new_file.write('@ECHO OFF\n' + File.basename(file, '.*').gsub('-',' ') + ' $*')
end
File.delete(file)
next
elsif file.end_with?('.bat') then
File.open(file + '.bat', "w") do |new_file|
new_file.write('@ECHO OFF\n' + file.gsub('-', ' ') + ' $*')
end
File.delete(file)
next
end
end
end
main