Rewrite rust (#38)
Co-authored-by: kjuulh <contact@kjuulh.io> Reviewed-on: https://git.front.kjuulh.io/kjuulh/octopush/pulls/38
This commit is contained in:
@@ -1,12 +1,38 @@
|
||||
package main
|
||||
|
||||
import "github.com/bitfield/script"
|
||||
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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user