输出目录
All checks were successful
代码更新通知 / update-server (push) Successful in 5s

This commit is contained in:
2024-12-18 15:18:11 +08:00
parent 3ac378c589
commit 78da95269c
2 changed files with 19 additions and 15 deletions

30
main.go
View File

@@ -9,8 +9,11 @@ import (
"github.com/gotify/go-api-client/v2/models"
"github.com/sethvargo/go-githubactions"
"github.com/spf13/cast"
"io/fs"
"net/http"
"net/url"
"os"
"path/filepath"
"time"
)
@@ -32,19 +35,20 @@ func main() {
username := githubactions.GetInput("username")
fmt.Printf("username is %s\n", username)
//dir, _ := os.Getwd()
//root := filepath.Join(dir, "../")
//filepath.WalkDir(root, func(path string, d fs.DirEntry, err error) error {
// if d.IsDir() {
// if d.Name() == ".git" {
// return filepath.SkipDir
// }
// return nil
// }
// body, _ = os.ReadFile(path)
// fmt.Printf("path: %s\n%s\n\n", path, string(body))
// return nil
//})
dir, _ := os.Getwd()
root := filepath.Join(dir, "../")
filepath.WalkDir(root, func(path string, d fs.DirEntry, err error) error {
if d.IsDir() {
if d.Name() == ".git" {
return filepath.SkipDir
}
return nil
}
//body, _ = os.ReadFile(path)
fmt.Printf("path: %s\n", path)
//fmt.Printf("path: %s\n%s\n\n", path, string(body))
return nil
})
githubactions.SetOutput("time", time.Now().Format("2006-01-02 15:04:05"))
}