2020-09-22 20:25:45 +02:00
|
|
|
extends Control
|
|
|
|
|
|
|
|
func _ready():
|
2020-09-29 18:21:39 +02:00
|
|
|
var path = null
|
|
|
|
|
2020-09-29 17:52:31 +02:00
|
|
|
var args = helpers.parse_args()
|
|
|
|
if args.has("sandbox"):
|
|
|
|
if args["sandbox"] is String:
|
2020-09-29 18:21:39 +02:00
|
|
|
if args["sandbox"] == ".":
|
|
|
|
args["sandbox"] = OS.get_environment("PWD")
|
2023-09-06 16:04:23 +02:00
|
|
|
|
|
|
|
if DirAccess.open(args["sandbox"]):
|
2020-09-29 17:52:31 +02:00
|
|
|
path = args["sandbox"]
|
|
|
|
else:
|
2023-09-06 16:04:23 +02:00
|
|
|
helpers.crash("DirAccess %s does not exist" % args["sandbox"])
|
2020-09-29 17:52:31 +02:00
|
|
|
|
2020-09-29 18:21:39 +02:00
|
|
|
if path == null:
|
2020-10-26 19:56:52 +01:00
|
|
|
path = game.tmp_prefix+"/repos/sandbox/"
|
2020-09-29 18:21:39 +02:00
|
|
|
helpers.careful_delete(path)
|
|
|
|
|
2021-02-04 15:19:54 +01:00
|
|
|
game.global_shell.run("mkdir '%s'" % path)
|
2020-09-29 18:21:39 +02:00
|
|
|
game.global_shell.cd(path)
|
|
|
|
game.global_shell.run("git init")
|
|
|
|
game.global_shell.run("git symbolic-ref HEAD refs/heads/main")
|
|
|
|
|
2020-09-29 18:36:24 +02:00
|
|
|
$Columns/Repository.path = path
|
2020-09-22 21:56:22 +02:00
|
|
|
|
2023-09-06 16:04:23 +02:00
|
|
|
#ToDo strech modes
|
|
|
|
#get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_2D, SceneTree.STRETCH_ASPECT_KEEP, Vector2(1920, 1080), 1.5)
|
2020-10-01 10:07:36 +02:00
|
|
|
|
|
|
|
$Columns/Terminal.repository = $Columns/Repository
|
|
|
|
|
|
|
|
func update_repo():
|
|
|
|
$Columns/Repository.update_everything()
|