Forked from marcosbitetti/version_controll_addon.gd
Created
November 4, 2019 05:45
-
-
Save davidas13/82178d3a6b4158ea6eaa7798a83be316 to your computer and use it in GitHub Desktop.
A version control helper to using in Godot Engine
This file contains hidden or 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
| ## | |
| # Automatic versioning the code using GIT | |
| # need GIT instaled on OS | |
| func _dev_auto_commit(): | |
| if OS.is_debug_build(): | |
| var path = '/usr/bin/git' | |
| var finder = File.new() | |
| if not finder.file_exists(path): | |
| if finder.file_exists('/usr/sbin/git'): | |
| path = '/usr/sbin/git' | |
| elif finder.file_exists('/usr/share/bin/git'): | |
| path = '/usr/share/bin/git' | |
| elif finder.file_exists('C:/Program Files (x86)/Git/git.exe'): | |
| path = 'C:/Program Files (x86)/Git/git.exe' | |
| elif finder.file_exists('C:/Program Files/Git/git.exe'): | |
| path = 'C:/Program Files/Git/git.exe' | |
| OS.execute(path, ['add','.'], true) | |
| OS.execute(path, ['commit','-am','Automatic commit from build'], false) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment