Mercurial Hosting > luan
comparison core/src/luan/modules/host/Hosting.luan @ 379:e9e445e28f0b
add error checking to Hosting
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 20 Apr 2015 12:24:54 -0600 |
parents | 6fd016d35ec1 |
children | 5b36f663a1b8 |
comparison
equal
deleted
inserted
replaced
378:bf60da9298f5 | 379:e9e445e28f0b |
---|---|
1 -- Hosting | 1 -- Hosting |
2 | 2 |
3 local Io = require "luan:Io" | 3 local Io = require "luan:Io" |
4 local Luan = require "luan:Luan" | |
5 local error = Luan.error | |
6 | |
4 | 7 |
5 port = 9101 | 8 port = 9101 |
6 | 9 |
7 function push(domain,password,dir) | 10 function push(domain,password,dir) |
11 local f = Io.Uri("file:"..dir) | |
12 f.exists() or error("directory '"..dir.."' not found") | |
13 f.is_directory() or error("'"..dir.."' is not a directory") | |
8 local socket = "socket:" .. domain .. ":" .. port | 14 local socket = "socket:" .. domain .. ":" .. port |
9 local pc = Io.Uri(socket).Pickle_client() | 15 local pc = Io.Uri(socket).Pickle_client() |
10 local pickle = pc.pickle | 16 local pickle = pc.pickle |
11 pc.call(%> | 17 pc.call(%> |
12 local Hosting = require "luan:host/Hosting" | 18 local Hosting = require "luan:host/Hosting" |