Created
October 15, 2016 21:32
-
-
Save marcosbitetti/7bc0226a6d00264014e23a992d3441fd 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