lang: funcs: Add deploy package with readfile related functions

This adds a readfile function to actually access files from our deploy.
A fun side effect is that we can even access our own code! In general,
it's a good reminder that you should only run trusted code on your own
infrastructure. This also includes a fancy new test case.
This commit is contained in:
James Shubin
2019-07-23 01:28:10 -04:00
parent 066048f4de
commit ed4ee3b58e
24 changed files with 644 additions and 0 deletions

View File

@@ -0,0 +1 @@
This is a different file3 in the files/ folder inside of the mod1/ module.

View File

@@ -0,0 +1,6 @@
import "deploy"
# relative paths for us
$f = "/files/file3" # real file is in: /mod1/files/file3
$f3 = deploy.abspath($f)
$x3 = deploy.readfile($f)

View File

@@ -0,0 +1 @@
#files: "files/" # these are some extra files we can use (is the default)