mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-03 19:04:40 +01:00
24 lines
461 B
GDScript
24 lines
461 B
GDScript
extends Node
|
|
|
|
var tmp_prefix = "/tmp/"
|
|
var global_shell
|
|
|
|
func _ready():
|
|
global_shell = Shell.new()
|
|
global_shell.cd(tmp_prefix)
|
|
|
|
func read_file(path):
|
|
print ("reading " + path)
|
|
var file = File.new()
|
|
file.open(path, File.READ)
|
|
var content = file.get_as_text()
|
|
file.close()
|
|
return content
|
|
|
|
func write_file(path, content):
|
|
print ("writing " + path)
|
|
var file = File.new()
|
|
file.open(path, File.WRITE)
|
|
file.store_string(content)
|
|
file.close()
|
|
return true
|