mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-13 19:04:54 +01:00
Hardcoded windows paths for testing
This commit is contained in:
parent
724a5fff03
commit
5ac3523817
3 changed files with 8 additions and 14 deletions
14
game.gd
14
game.gd
|
@ -9,9 +9,9 @@ func _ready():
|
|||
global_shell = Shell.new()
|
||||
|
||||
# Copy fake-editor to tmp directory (because the original might be in a .pck file).
|
||||
var fake_editor = tmp_prefix + "fake-editor"
|
||||
fake_editor = tmp_prefix + "fake-editor"
|
||||
var content = game.read_file("res://scripts/fake-editor")
|
||||
write_file(fake_editor, content)
|
||||
write_file('C:\\Users\\1\\AppData\\Local\\Temp\\fake-editor', content)
|
||||
global_shell.run("chmod u+x " + fake_editor)
|
||||
|
||||
func read_file(path):
|
||||
|
@ -34,11 +34,5 @@ func write_file(path, content):
|
|||
|
||||
func _tmp_prefix():
|
||||
var os = OS.get_name()
|
||||
|
||||
if os == "X11":
|
||||
return "/tmp/"
|
||||
elif os == "Windows":
|
||||
return "%temp%/"
|
||||
else:
|
||||
push_error("Unsupported OS")
|
||||
get_tree().quit()
|
||||
return "/tmp/"
|
||||
|
||||
|
|
3
main.gd
3
main.gd
|
@ -81,7 +81,7 @@ func construct_repo(script, path):
|
|||
# the script somewhere in the filesystem.
|
||||
var content = game.read_file(script)
|
||||
var script_path = game.tmp_prefix+"/git-hydra-script"
|
||||
game.write_file(script_path, content)
|
||||
game.write_file('C:\\Users\\1\\AppData\\Local\\Temp\\git-hydra-script', content)
|
||||
|
||||
game.global_shell.run("mkdir " + path)
|
||||
game.global_shell.cd(path)
|
||||
|
@ -93,6 +93,7 @@ func construct_repo(script, path):
|
|||
|
||||
func _process(_delta):
|
||||
if server.is_connection_available():
|
||||
print("Client connected")
|
||||
client_connection = server.take_connection()
|
||||
read_commit_message()
|
||||
|
||||
|
|
5
shell.gd
5
shell.gd
|
@ -2,7 +2,6 @@ extends Node
|
|||
class_name Shell
|
||||
|
||||
var _cwd
|
||||
var _fake_editor
|
||||
|
||||
signal output(text)
|
||||
|
||||
|
@ -21,7 +20,7 @@ func run(command):
|
|||
print("$ %s" % command)
|
||||
|
||||
var env = {}
|
||||
env["EDITOR"] = _fake_editor
|
||||
env["EDITOR"] = game.fake_editor
|
||||
|
||||
var hacky_command = ""
|
||||
for variable in env:
|
||||
|
@ -72,7 +71,7 @@ func run_async_thread(command):
|
|||
|
||||
# Run a simple command with arguments, blocking, using OS.execute.
|
||||
func _exec(command, args=[]):
|
||||
var debug = false
|
||||
var debug = true
|
||||
|
||||
if debug:
|
||||
print("exec: %s [%s]" % [command, PoolStringArray(args).join(", ")])
|
||||
|
|
Loading…
Reference in a new issue