bufanyun/hotgo

最新版本更新了addons的目录,make build后提示找不到插件目录。

jimmyken opened this issue · 11 comments

cannot find "addons/hgexample/resource/public" in following paths:

  1. /data/website/xxxxx
    1). github.com/gogf/gf/v2/os/gfile.Search
    /Users/xxxx/go/pkg/mod/github.com/gogf/gf/v2@v2.5.2/os/gfile/gfile_search.go:55
    2). github.com/gogf/gf/v2/net/ghttp.(*Server).AddStaticPath
    /Users/xxx/go/pkg/mod/github.com/gogf/gf/v2@v2.5.2/net/ghttp/ghttp_server_config_static.go:92
    3). hotgo/internal/library/addons.AddStaticPath
    /xxxxx/code/hotgo/server/internal/library/addons/module.go:162

我也遇到这个情况,我是把 addons/hgexample/resources 路径单独添加到 hack配置文件的packSrc属性里

看看实际是不是没有这个目录,新建一下就好了,我看包里是有的

我也遇到这个情况,我是把 addons/hgexample/resources 路径单独添加到 hack配置文件的packSrc属性里

加入后make build提示找不到:
path 'internal/packed/packed.go' is not empty, files might be overwrote, continue? [y/n]: 2023-09-16 09:02:27.007 [FATA] pack failed: cannot find "addons/hgexample/resources" in following paths:

看看实际是不是没有这个目录,新建一下就好了,我看包里是有的

确定是有这个目录的。

这个版本的更新是addons的模板,是不是没有考虑到go run main.go的相对路径与make build目录的绝对路径不一样了?

我也遇到这个情况,我是把 addons/hgexample/resources 路径单独添加到 hack配置文件的packSrc属性里

加入后make build提示找不到:

path 'internal/packed/packed.go' is not empty, files might be overwrote, continue? [y/n]: 2023-09-16 09:02:27.007 [FATA] pack failed: cannot find "addons/hgexample/resources" in following paths:

我倒是没出现你的这种情况,建议从新下载源码测试一下。

我倒是没出现你的这种情况,建议从新下载源码测试一下。

是重新下载了代码,下面是我的config.yaml

CLI tool, only in development environment.

https://goframe.org/pages/viewpage.action?pageId=3673173

gfcli:
build:
name: "hotgo" # 编译后的可执行文件名称
arch: "amd64" #不填默认当前系统架构,可选:386,amd64,arm,all
system: "linux"
mod: "none"
cgo: 0
packSrc: "resource,addons/hgexample/resources" # 将resource目录打包进可执行文件,静态资源无需单独部署
packDst: "internal/packed/packed.go" # 打包后生成的Go文件路径,一般使用相对路径指定到本项目目录中
version: ""
output: "./temp/hotgo" # 可执行文件生成路径
extra: ""

我出现这种情况的操作步骤:

1、 在源码目录下 make build 打包生成temp 目录
2、 将生成的 temp 目录(包含配置文件)复制到别的目录下运行 就会出现 addons/hgexample/resources/public 找不到的情况

所以我把 addons/hgexample/resources 在 打包之前就添加到 hack/config/config.yaml 下的packSrc里边 在打包部署

我出现这种情况的操作步骤:

1、 在源码目录下 make build 打包生成temp 目录 2、 将生成的 temp 目录(包含配置文件)复制到别的目录下运行 就会出现 addons/hgexample/resources/public 找不到的情况

所以我把 addons/hgexample/resources 在 打包之前就添加到 hack/config/config.yaml 下的packSrc里边 在打包部署

太奇怪了,你的arch和system是什么?

我出现这种情况的操作步骤:

1、 在源码目录下 make build 打包生成temp 目录 2、 将生成的 temp 目录(包含配置文件)复制到别的目录下运行 就会出现 addons/hgexample/resources/public 找不到的情况

所以我把 addons/hgexample/resources 在 打包之前就添加到 hack/config/config.yaml 下的packSrc里边 在打包部署

太奇怪了,你的arch和system是什么?

都是注释掉的 估计和这个关系不大

编译后直接运行报这个错是正常的,把这个目录加到hack/config/config.yaml packSrc中或者手动创建一下。

除了这个目录以外还有几个类似的,首次部署的时候手动创建一下就行

是的。我的是在hack/config.yaml的packSrc上增加addons/hgexample/resource(注意不是resources)。有多少个插件加多少个。