os.#File: simplify API

Signed-off-by: Solomon Hykes <solomon@dagger.io>
This commit is contained in:
Solomon Hykes
2021-06-09 18:37:05 +00:00
committed by Solomon Hykes
parent 9984edad09
commit 9d85bab9e7
9 changed files with 86 additions and 25 deletions

26
stdlib/.dagger/env/os/plan/main.cue vendored Normal file
View File

@@ -0,0 +1,26 @@
package main
import (
"dagger.io/os"
"dagger.io/alpine"
)
// Write a file to an empty dir
EmptyDir: {
f: os.#File & {
path: "/foo.txt"
write: data: "hello world!"
}
f: contents: "hello world!"
}
// Read from a pre-existing file
Read: {
f: os.#File & {
from: alpine.#Image & {
version: "3.13.4"
}
path: "/etc/alpine-release"
}
f: contents: "3.13.4\n"
}