mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 09:49:12 +08:00
27 lines
689 B
Ruby
27 lines
689 B
Ruby
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
|
|
|