Skip to content

Commit

Permalink
增加了--icon_path
Browse files Browse the repository at this point in the history
  • Loading branch information
jicheng1014 committed Mar 23, 2023
1 parent fa83073 commit a5c9585
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ test.go
*.apk
*.ipa
.vscode/*
michael_jordan.png
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ go-fir-cli 只实现了 fir-cli 的部分功能, 并无计划实现全部功能,
由于作者不善 golang, 所以大部分代码皆来自于 Copilot 和 chatGPT 生成, 作者仅在此基础上做了一些修改与调试, 以便于使用. 如果您在使用中发现任何问题, 欢迎提 issue 或者 pr.

## 更新说明
- 0.0.8 增加了自定义图标参数 --icon_path
- 0.0.7 支持了持久化登录
- 0.0.6 支持了windows平台
- 0.0.5 支持了上传进度条显示
Expand Down
6 changes: 0 additions & 6 deletions analysis/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ type AppFileInfo struct {
Changelog string
}

type IUploadApp interface {
GetIcon() image.Image
GetAppFileInfo() map[string]string
FilePath() string
}

type UploadAppService struct {
AppFileInfo *AppFileInfo
FilePath string
Expand Down
6 changes: 5 additions & 1 deletion api/rio_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type FirApi struct {
ApiToken string
AppChangelog string
Email string
CustomIconPath string
QrCodePngNeed bool
QrCodeAsciiNeed bool
ApiAppInfo *ApiAppInfo
Expand Down Expand Up @@ -154,7 +155,6 @@ func (f *FirApi) UploadPrepare(file string) (AppPrepareUploadData, error) {
var err error

if f.uploadAppService == nil {
// uploadAppService, err := analysis.NewUploadAppService(file)
f.uploadAppService, err = analysis.NewUploadAppService(file)
if err != nil {
fmt.Println(err)
Expand Down Expand Up @@ -305,6 +305,10 @@ func (f *FirApi) uploadAppIcon(file string, uploadingInfo AppPrepareUploadData)
}
iconFile := "blob"

if f.CustomIconPath != "" {
iconFile = f.CustomIconPath
}

uploadFile, _ := os.Open(iconFile)
defer uploadFile.Close()

Expand Down
2 changes: 1 addition & 1 deletion constants/constants.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package constants

const VERSION = "0.0.7"
const VERSION = "0.0.8"
const USER_AGENT = "go-fir-" + VERSION
11 changes: 9 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func initCli() {
logoutCommand(),
testWebhook(),
uploadFile(),
cli.Command{
{
Name: "version",
ShortName: "v",
Usage: "查看 go-fir-cli 版本",
Expand All @@ -44,7 +44,7 @@ func initCli() {
return nil
},
},
cli.Command{
{
Name: "upgrade",
Usage: "如何升级 go-fir-cli",
Action: func(c *cli.Context) error {
Expand Down Expand Up @@ -138,6 +138,12 @@ func uploadFile() cli.Command {
Name: "file, f",
Usage: "apk 或者 ipa 的文件路径",
},

cli.StringFlag{
Name: "icon_path, ip",
Usage: "如果需要自定义icon, 则这里传 icon 的路径",
},

cli.StringFlag{
Name: "changelog, c",
Usage: "app 的更新日志, 可以是文件路径, 也可以是字符串",
Expand Down Expand Up @@ -226,6 +232,7 @@ func uploadFile() cli.Command {

api := api.FirApi{
ApiToken: token,
CustomIconPath: c.String("icon_path"),
AppChangelog: changelog,
QrCodePngNeed: c.Bool("qrcode"),
QrCodeAsciiNeed: c.Bool("qrcodeascii"),
Expand Down

0 comments on commit a5c9585

Please sign in to comment.