diff --git a/game.gd b/game.gd index 27f6c91..786d8f8 100644 --- a/game.gd +++ b/game.gd @@ -2,13 +2,15 @@ extends Node var tmp_prefix = "/tmp/" var global_shell +var debug = false func _ready(): global_shell = Shell.new() global_shell.cd(tmp_prefix) func read_file(path): - print ("reading " + path) + if debug: + print("reading " + path) var file = File.new() file.open(path, File.READ) var content = file.get_as_text() @@ -16,7 +18,8 @@ func read_file(path): return content func write_file(path, content): - print ("writing " + path) + if debug: + print("writing " + path) var file = File.new() file.open(path, File.WRITE) file.store_string(content) diff --git a/main.gd b/main.gd index 2e05ca1..a508f7d 100644 --- a/main.gd +++ b/main.gd @@ -87,7 +87,9 @@ func construct_repo(script, path): shell.run("mkdir " + path) shell.cd(path) shell.run("git init") - print(shell.run("source "+script_path)) + var output = shell.run("source "+script_path) + if game.debug: + print(output) func _process(delta): if server.is_connection_available(): diff --git a/shell.gd b/shell.gd index 7514748..9e67ea3 100644 --- a/shell.gd +++ b/shell.gd @@ -17,7 +17,7 @@ func cd(dir): # Run a shell command given as a string. Run this if you're interested in the # output of the command. func run(command): - var debug = true + var debug = false if debug: print("$ %s" % command)