Build custom .gitconfig for the game environment

Fixes #3.
This commit is contained in:
blinry 2020-10-29 17:23:12 +01:00
parent 25d8905df8
commit 617adc8e06
5 changed files with 15 additions and 9 deletions

View file

@ -13,6 +13,8 @@ var state = {}
func _ready():
global_shell = Shell.new()
create_file_in_game_env(".gitconfig", helpers.read_file("res://scripts/gitconfig"))
create_file_in_game_env("fake-editor", helpers.read_file("res://scripts/fake-editor"))
fake_editor = tmp_prefix + "fake-editor"
global_shell.run("chmod u+x '%s'" % fake_editor)

View file

@ -83,7 +83,6 @@ func construct():
game.global_shell.run("mkdir '%s'" % repo.path)
game.global_shell.cd(repo.path)
game.global_shell.run("git init")
game.global_shell.run("git symbolic-ref HEAD refs/heads/main")
# Add other repos as remotes.
for r2 in repos:

View file

@ -100,7 +100,6 @@ func children_set(new_children):
if not children.has(c):
var a = arrow.instance()
if type == "commit":
#a = time_arrow.instance()
a.source = c
a.target = id
a.color = Color("c2bf26")

View file

@ -24,13 +24,7 @@ func run(command, crash_on_fail=true):
print("$ %s" % command)
var env = {}
if game.fake_editor:
env["GIT_EDITOR"] = game.fake_editor.replace(" ", "\\ ")
env["GIT_AUTHOR_NAME"] = "You"
env["GIT_COMMITTER_NAME"] = "You"
env["GIT_AUTHOR_EMAIL"] = "you@example.com"
env["GIT_COMMITTER_EMAIL"] = "you@example.com"
env["GIT_TEMPLATE_DIR"] = ""
env["HOME"] = game.tmp_prefix
var hacky_command = ""
for variable in env:

12
scripts/gitconfig Normal file
View file

@ -0,0 +1,12 @@
[user]
email = you@time.agency
name = You
[core]
editor = ~/fake-editor
[init]
templateDir = ""
defaultBranch = main
[log]
decorate = true
[advice]
detachedHead = false