mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-13 19:04:54 +01:00
20 lines
475 B
GDScript3
20 lines
475 B
GDScript3
|
extends Node2D
|
||
|
|
||
|
func _ready():
|
||
|
|
||
|
var path = game.tmp_prefix_inside+"/repos/sandbox/"
|
||
|
helpers.careful_delete(path)
|
||
|
|
||
|
game.global_shell.run("mkdir " + path)
|
||
|
game.global_shell.cd(path)
|
||
|
game.global_shell.run("git init")
|
||
|
game.global_shell.run("git symbolic-ref HEAD refs/heads/main")
|
||
|
game.global_shell.run("git commit --allow-empty -m 'Initial commit'")
|
||
|
|
||
|
$Repository.path = path
|
||
|
|
||
|
$Terminal.repository = $Repository
|
||
|
|
||
|
func _update_repo():
|
||
|
$Repository.update_everything()
|