(appId string)
| 844 | } |
| 845 | |
| 846 | func generateBuilderAppData(appId string) (string, string, string, error) { |
| 847 | appGoFile := "" |
| 848 | fileData, err := waveappstore.ReadAppFile(appId, "app.go") |
| 849 | if err == nil { |
| 850 | appGoFile = string(fileData.Contents) |
| 851 | } |
| 852 | |
| 853 | staticFilesJSON := "" |
| 854 | allFiles, err := waveappstore.ListAllAppFiles(appId) |
| 855 | if err == nil { |
| 856 | var staticFiles []StaticFileInfo |
| 857 | for _, entry := range allFiles.Entries { |
| 858 | if strings.HasPrefix(entry.Name, "static/") { |
| 859 | staticFiles = append(staticFiles, StaticFileInfo{ |
| 860 | Name: entry.Name, |
| 861 | Size: entry.Size, |
| 862 | Modified: entry.Modified, |
| 863 | ModifiedTime: entry.ModifiedTime, |
| 864 | }) |
| 865 | } |
| 866 | } |
| 867 | |
| 868 | if len(staticFiles) > 0 { |
| 869 | staticFilesBytes, marshalErr := json.Marshal(staticFiles) |
| 870 | if marshalErr == nil { |
| 871 | staticFilesJSON = string(staticFilesBytes) |
| 872 | } |
| 873 | } |
| 874 | } |
| 875 | |
| 876 | platformInfo := wavebase.GetSystemSummary() |
| 877 | if currentUser, userErr := user.Current(); userErr == nil && currentUser.Username != "" { |
| 878 | platformInfo = fmt.Sprintf("Local Machine: %s, User: %s", platformInfo, currentUser.Username) |
| 879 | } else { |
| 880 | platformInfo = fmt.Sprintf("Local Machine: %s", platformInfo) |
| 881 | } |
| 882 | |
| 883 | return appGoFile, staticFilesJSON, platformInfo, nil |
| 884 | } |
no test coverage detected