mirror of
				https://github.com/cmderdev/cmder.git
				synced 2025-11-04 03:12:16 +08:00 
			
		
		
		
	Cleanup of the cleanup file
Moved the cleanup to another branch
This commit is contained in:
		@@ -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()
 | 
					 | 
				
			||||||
@@ -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
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		Reference in New Issue
	
	Block a user