diff options
| author | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2026-06-03 22:31:42 +0200 |
|---|---|---|
| committer | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2026-06-03 23:30:17 +0200 |
| commit | 341af788ffb60b1066f7735c10a2ef8480ec0aa9 (patch) | |
| tree | b1acbfe48184a263098e6146922730dd7ece8808 /util.lua | |
| parent | a42c94e103ecf7cb365a8888c3f5afc785def284 (diff) | |
| download | r6p-main.tar.xz | |
Diffstat (limited to 'util.lua')
| -rw-r--r-- | util.lua | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -16,7 +16,11 @@ local function json_enc(x) return json:encode(x) end -local mkdir, rand_string +local function send(peer, x) + peer:send(json_enc(x)) +end + +local rand_string if love then rand_string = function(n) @@ -33,11 +37,6 @@ else local rand_file = rand_file or io.open("/dev/random") return rand_file:read(n) end - -- awful - mkdir = function(x) - local status = os.execute("mkdir -p " .. x) - return status == true - end end return { @@ -47,4 +46,5 @@ return { base64_enc = base64.encode, json_dec = json_dec, json_enc = json_enc, + send = send, } |
