changeset 1788:0a06d59578aa

add push_file
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 22 Dec 2023 09:48:52 -0700
parents aed284cae1f0
children bac27b119ff2
files src/luan/modules/host/Hosting.luan src/luan/modules/host/push_file.luan
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/luan/modules/host/Hosting.luan	Tue Dec 12 19:15:29 2023 -0700
+++ b/src/luan/modules/host/Hosting.luan	Fri Dec 22 09:48:52 2023 -0700
@@ -84,6 +84,7 @@
 	for _, s in ipairs(path) do
 		there = there.children[s] or error("'"..s.."' not found on remote")
 	end
+	print("copying "..my_file.to_string())
 	host.copy_file(domain,password,there.path,my_file.name(),my_file.read_binary())
 	host.update_handler(domain,password)
 	host.close()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/luan/modules/host/push_file.luan	Fri Dec 22 09:48:52 2023 -0700
@@ -0,0 +1,12 @@
+local Io = require "luan:Io.luan"
+local print = Io.print
+local Hosting = require "luan:host/Hosting.luan"
+
+if #{...} ~= 4 then
+	Io.stderr.write "usage: luan luan:host/push_test.luan domain password dir file\n"
+	return
+end
+
+Hosting.push_file(...)
+
+print("done with "..(...))