returns (value, metakey)
(meta waveobj.MetaMapType, connName string, shellType string)
| 848 | |
| 849 | // returns (value, metakey) |
| 850 | func getCustomInitScriptValue(meta waveobj.MetaMapType, connName string, shellType string) (string, string) { |
| 851 | keys := getCustomInitScriptKeyCascade(shellType) |
| 852 | connMeta := meta.GetConnectionOverride(connName) |
| 853 | if connMeta != nil { |
| 854 | for _, key := range keys { |
| 855 | if connMeta.HasKey(key) { |
| 856 | return connMeta.GetString(key, ""), "blockmeta/[" + connName + "]/" + key |
| 857 | } |
| 858 | } |
| 859 | } |
| 860 | for _, key := range keys { |
| 861 | if meta.HasKey(key) { |
| 862 | return meta.GetString(key, ""), "blockmeta/" + key |
| 863 | } |
| 864 | } |
| 865 | fullConfig := wconfig.GetWatcher().GetFullConfig() |
| 866 | connKeywords := fullConfig.Connections[connName] |
| 867 | connKeywordsMap := make(map[string]any) |
| 868 | err := utilfn.ReUnmarshal(&connKeywordsMap, connKeywords) |
| 869 | if err != nil { |
| 870 | log.Printf("error re-unmarshalling connKeywords: %v\n", err) |
| 871 | return "", "" |
| 872 | } |
| 873 | ckMeta := waveobj.MetaMapType(connKeywordsMap) |
| 874 | for _, key := range keys { |
| 875 | if ckMeta.HasKey(key) { |
| 876 | return ckMeta.GetString(key, ""), "connections.json/" + connName + "/" + key |
| 877 | } |
| 878 | } |
| 879 | return "", "" |
| 880 | } |
| 881 | |
| 882 | func updateTermSize(shellProc *shellexec.ShellProc, blockId string, termSize waveobj.TermSize) { |
| 883 | err := setTermSizeInDB(blockId, termSize) |
no test coverage detected