MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / getAppFromRepo

Function getAppFromRepo

agent/app/service/app.go:890–906  ·  view source on GitHub ↗
(downloadPath string)

Source from the content-addressed store, hash-verified

888}
889
890func 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
908func getAppList() (*dto.AppList, error) {
909 list := &dto.AppList{}

Callers 1

getAppListFunction · 0.85

Calls 2

DecompressMethod · 0.95
DeleteFileMethod · 0.95

Tested by

no test coverage detected