Revert "rename: hotswapbureau >> hotbureau"

This reverts commit 76dde7a0e0.
This commit is contained in:
gengbing
2023-02-15 22:39:27 +08:00
parent 4528bbfd28
commit cd2c9b45ff
4 changed files with 10 additions and 22 deletions

View File

@@ -31,11 +31,8 @@ import (
"golang.org/x/tools/go/packages"
)
var (
hotswapBureauPackageNames = [...]string{
"hotbureau",
"hotswapbureau",
}
const (
hotswapBureauPackageName = "hotswapbureau"
)
const (
@@ -451,11 +448,9 @@ func removeStaticFiles(args completePluginArgs) {
}
if args.cleanOnly {
for _, pkgName := range hotswapBureauPackageNames {
bureauDir := filepath.Join(args.pluginDir, pkgName)
if err := hutils.FindDirectory(bureauDir, ""); err == nil {
_ = os.RemoveAll(bureauDir)
}
bureauDir := filepath.Join(args.pluginDir, hotswapBureauPackageName)
if err := hutils.FindDirectory(bureauDir, ""); err == nil {
_ = os.RemoveAll(bureauDir)
}
}
@@ -908,14 +903,7 @@ func parseHotswapComment(group *ast.CommentGroup) string {
}
func genHotswapBureau(args completePluginArgs, generated *generatedFiles) {
for _, pkgName := range hotswapBureauPackageNames {
bureauDir := filepath.Join(args.pluginDir, pkgName)
if err := hutils.FindDirectory(bureauDir, ""); err == nil {
_ = os.RemoveAll(bureauDir)
}
}
dir := filepath.Join(args.tmpDir, hotswapBureauPackageNames[0])
dir := filepath.Join(args.tmpDir, hotswapBureauPackageName)
if err := os.MkdirAll(dir, 0744); err != nil {
panic(err)
}
@@ -957,7 +945,7 @@ func genHotswapMain(args completePluginArgs, livePackages map[string]*packages.P
LivePackages []string
}{
PackageName: pkgName,
BureauPackagePath: path.Join(args.tmpPkgPath, hotswapBureauPackageNames[0]),
BureauPackagePath: path.Join(args.tmpPkgPath, hotswapBureauPackageName),
LivePackages: a,
}
@@ -987,7 +975,7 @@ func genHotswapLive(args completePluginArgs, dir string, pkg *packages.Package,
LiveTypes []string
}{
PackageName: pkg.Name,
BureauPackagePath: path.Join(args.tmpPkgPath, hotswapBureauPackageNames[0]),
BureauPackagePath: path.Join(args.tmpPkgPath, hotswapBureauPackageName),
LiveFuncs: liveFuncs,
LiveTypes: liveTypes,
}

View File

@@ -3,7 +3,7 @@
package dog
import (
"github.com/edwingeng/hotswap/demo/slink/plugin/dog/hotbureau"
"github.com/edwingeng/hotswap/demo/slink/plugin/dog/hotswapbureau"
_ "github.com/edwingeng/hotswap/demo/slink/plugin/dog/woof"
)

View File

@@ -3,7 +3,7 @@
package woof
import (
"github.com/edwingeng/hotswap/demo/slink/plugin/dog/hotbureau"
"github.com/edwingeng/hotswap/demo/slink/plugin/dog/hotswapbureau"
)
func init() {