Skip to content

Commit 9ed7855

Browse files
committed
fix(init): 修正生成的配置文件路径定位错误的问题
1 parent 725bbff commit 9ed7855

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

internal/config/config.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ const fileHeader = `# 此文件由 gobuild<https://github.com/caixw/gobuild> 生
2424
`
2525

2626
func initOptions(wd, base, configFilename string) error {
27-
dir := path.Join(binBaseDir, base)
2827
o := &watch.Options{
29-
MainFiles: path.Join("./", dir),
28+
MainFiles: "./" + path.Join(binBaseDir, base), // path.Join 会将 ./ 去除,所以 ./ 不能在 path.Join 中。
3029
Excludes: []string{configFilename},
3130
Exts: []string{".go", ".yaml", ".xml", ".yml", ".json"}, // 配置文件修改也重启
3231
WatcherFrequency: watch.MinWatcherFrequency,

0 commit comments

Comments
 (0)