MCPcopy
hub / github.com/wavetermdev/waveterm / fileCatRun

Function fileCatRun

cmd/wsh/cmd/wshcmd-file.go:169–185  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

167}
168
169func fileCatRun(cmd *cobra.Command, args []string) error {
170 path, err := fixRelativePaths(args[0])
171 if err != nil {
172 return err
173 }
174
175 fileData := wshrpc.FileData{
176 Info: &wshrpc.FileInfo{
177 Path: path}}
178
179 err = streamReadFromFile(cmd.Context(), fileData, os.Stdout)
180 if err != nil {
181 return fmt.Errorf("reading file: %w", err)
182 }
183
184 return nil
185}
186
187func fileInfoRun(cmd *cobra.Command, args []string) error {
188 path, err := fixRelativePaths(args[0])

Callers

nothing calls this directly

Calls 3

fixRelativePathsFunction · 0.85
streamReadFromFileFunction · 0.85
ContextMethod · 0.45

Tested by

no test coverage detected