$ gf pack -h
USAGE
gf pack SRC DST
ARGUMENT
SRC source path for packing, which can be multiple source paths.
DST destination file path for packed file. if extension of the filename is ".go" and "-n" option is given,
it enables packing SRC to go file, or else it packs SRC into a binary file.
OPTION
-n, --name package name for output go file, it's set as its directory name if no name passed
-p, --prefix prefix for each file packed into the resource file
-k, --keepPath keep the source path from system to resource file, usually for relative path
-h, --help more information about this command
EXAMPLE
gf pack public data.bin
gf pack public,template data.bin
gf pack public,template packed/data.go
gf pack public,template,config packed/data.go
gf pack public,template,config packed/data.go -n=packed -p=/var/www/my-app
gf pack /var/www/public packed/data.go -n=packed
7 Comments
lfzxs
windows 执行“gf pack resource,manifest/config packed/build_pack_data.go” 提示 “ DST path 'manifest/config' cannot be a directory ”怎么回事? 多个目录打包不行吗?
CLI Built Detail:
Go Version: go1.17.7
GF Version: v2.0.6
Git Commit: 2022-03-31 16:57:32 66803fd6641e31c60f0489180668243ea092b87b
Build Time: 2022-03-31 16:55:38
海亮
试了没有问题,你是不是敲的时候多了个空格?
叮当猫
没看懂这个命令到底要干什么,博主的文档实在难以理解。
糖水不加糖
例如把配置文件打包进二进制文件中
叮当猫
多谢!
郭强
把
js/css/image
这些文件打包到二进制文件中,最终交付的时候只有一个二进制文件。叮当猫
多谢!