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

Function fixRelativePaths

cmd/wsh/cmd/wshcmd-file-util.go:128–147  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

126}
127
128func fixRelativePaths(path string) (string, error) {
129 conn, err := connparse.ParseURI(path)
130 if err != nil {
131 return "", err
132 }
133 if conn.Scheme == connparse.ConnectionTypeWsh {
134 if conn.Host == connparse.ConnHostCurrent {
135 conn.Host = RpcContext.Conn
136 fixedPath, err := fileutil.FixPath(conn.Path)
137 if err != nil {
138 return "", err
139 }
140 conn.Path = fixedPath
141 }
142 if conn.Host == "" {
143 conn.Host = wshrpc.LocalConnName
144 }
145 }
146 return conn.GetFullURI(), nil
147}

Callers 8

fileCatRunFunction · 0.85
fileInfoRunFunction · 0.85
fileRmRunFunction · 0.85
fileWriteRunFunction · 0.85
fileAppendRunFunction · 0.85
fileCpRunFunction · 0.85
fileMvRunFunction · 0.85
fileListRunFunction · 0.85

Calls 3

ParseURIFunction · 0.92
FixPathFunction · 0.92
GetFullURIMethod · 0.80

Tested by

no test coverage detected