-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from MartiUK/gitcleanup
Git exe Cleanup + some bonuses
- Loading branch information
Showing
6 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
## Bin | ||
|
||
This folder will be injected into path at runtime | ||
This folder will be injected into the PATH environment variable at runtime. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
## Config | ||
|
||
All config files must be in this folder, if there is no option to set the folder directly, it has to be hardlinked. | ||
All config files must be in this folder. If there is no option to set this folder directly, it has to be hardlinked. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
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 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
## Vendor | ||
|
||
Software from third parties + init sctipt | ||
Third parties software & init script. |