mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-06 15:20:22 +00:00
fix: make lint&ci happy
This commit is contained in:
51
abineundo/ref/main.go
Normal file
51
abineundo/ref/main.go
Normal file
@@ -0,0 +1,51 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"io"
|
||||
"os"
|
||||
"path"
|
||||
)
|
||||
|
||||
func main() {
|
||||
root := flag.String("r", "", "project root dir")
|
||||
flag.Parse()
|
||||
|
||||
fi, err := os.Open(path.Join(*root, "main.go"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fo, err := os.Create(path.Join(*root, "abineundo/ref/main/main.go"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
_, err = io.Copy(fo, fi)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fi.Close()
|
||||
fo.Close()
|
||||
|
||||
regf := path.Join(*root, "custom/register.go")
|
||||
if _, err := os.Stat(regf); err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return
|
||||
}
|
||||
panic(err)
|
||||
}
|
||||
|
||||
fi, err = os.Open(regf)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fo, err = os.Create(path.Join(*root, "abineundo/ref/custom/register.go"))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
_, err = io.Copy(fo, fi)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fi.Close()
|
||||
fo.Close()
|
||||
}
|
||||
Reference in New Issue
Block a user