mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 09:49:12 +08:00
Initial commit of gitcleanup.py
Initial commit of gitcleanup.py
This commit is contained in:
parent
de30ed5424
commit
d396dd9d33
24
gitcleanup.py
Normal file
24
gitcleanup.py
Normal file
@ -0,0 +1,24 @@
|
||||
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()
|
Loading…
Reference in New Issue
Block a user