2020-09-22 21:25:45 +03:00
|
|
|
extends Control
|
|
|
|
|
|
|
|
func _ready():
|
2020-09-29 19:21:39 +03:00
|
|
|
var path = null
|
|
|
|
|
2020-09-29 18:52:31 +03:00
|
|
|
var args = helpers.parse_args()
|
|
|
|
if args.has("sandbox"):
|
|
|
|
if args["sandbox"] is String:
|
2020-09-29 19:21:39 +03:00
|
|
|
if args["sandbox"] == ".":
|
|
|
|
args["sandbox"] = OS.get_environment("PWD")
|
2020-09-29 18:52:31 +03:00
|
|
|
var dir = Directory.new()
|
|
|
|
if dir.dir_exists(args["sandbox"]):
|
|
|
|
path = args["sandbox"]
|
|
|
|
else:
|
|
|
|
helpers.crash("Directory %s does not exist" % args["sandbox"])
|
|
|
|
|
2020-09-29 19:21:39 +03:00
|
|
|
if path == null:
|
|
|
|
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")
|
|
|
|
|
2020-09-29 18:52:31 +03:00
|
|
|
$HSplitContainer/Repository.path = path
|
2020-09-22 22:56:22 +03:00
|
|
|
|
|
|
|
get_tree().set_screen_stretch(SceneTree.STRETCH_MODE_2D, SceneTree.STRETCH_ASPECT_KEEP, Vector2(1920, 1080), 1.5)
|