(downloadPath string)
| 888 | } |
| 889 | |
| 890 | func getAppFromRepo(downloadPath string) error { |
| 891 | downloadUrl := downloadPath |
| 892 | global.LOG.Infof("[AppStore] download file from %s", downloadUrl) |
| 893 | fileOp := files.NewFileOp() |
| 894 | packagePath := filepath.Join(global.Dir.ResourceDir, filepath.Base(downloadUrl)) |
| 895 | if err := files.DownloadFileWithProxy(downloadUrl, packagePath); err != nil { |
| 896 | return err |
| 897 | } |
| 898 | |
| 899 | if err := fileOp.Decompress(context.Background(), packagePath, global.Dir.ResourceDir, files.SdkZip, ""); err != nil { |
| 900 | return err |
| 901 | } |
| 902 | defer func() { |
| 903 | _ = fileOp.DeleteFile(packagePath) |
| 904 | }() |
| 905 | return nil |
| 906 | } |
| 907 | |
| 908 | func getAppList() (*dto.AppList, error) { |
| 909 | list := &dto.AppList{} |
no test coverage detected