octopush/_examples/actions/write_a_readme/main.go
Kasper Juul Hermansen 991861db99
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Rewrite rust (#38)
Co-authored-by: kjuulh <contact@kjuulh.io>
Reviewed-on: #38
2022-11-27 11:21:35 +00:00

39 lines
504 B
Go

package main
import (
"os"
"github.com/bitfield/script"
)
func main() {
_, err := script.
Echo("# Readme").
WriteFile("README.md")
if err != nil {
panic(err)
}
println("ran stuff")
entries, err := os.ReadDir(".")
if err != nil {
panic(err)
}
for _, entry := range entries {
if !entry.IsDir() {
file, err := os.ReadFile(entry.Name())
if err != nil {
panic(err)
}
println(string(file))
}
}
wd, err := os.Getwd()
if err != nil {
panic(err)
}
println(wd)
}