(ctx context.Context, path string)
| 463 | } |
| 464 | |
| 465 | func (impl *ServerImpl) RemoteMkdirCommand(ctx context.Context, path string) error { |
| 466 | cleanedPath := filepath.Clean(wavebase.ExpandHomeDirSafe(path)) |
| 467 | if stat, err := os.Stat(cleanedPath); err == nil { |
| 468 | if stat.IsDir() { |
| 469 | return fmt.Errorf("directory %q already exists", path) |
| 470 | } else { |
| 471 | return fmt.Errorf("cannot create directory %q, file exists at path", path) |
| 472 | } |
| 473 | } |
| 474 | if err := os.MkdirAll(cleanedPath, 0755); err != nil { |
| 475 | return fmt.Errorf("cannot create directory %q: %w", cleanedPath, err) |
| 476 | } |
| 477 | return nil |
| 478 | } |
| 479 | |
| 480 | func (*ServerImpl) RemoteWriteFileCommand(ctx context.Context, data wshrpc.FileData) error { |
| 481 | var truncate, append bool |
nothing calls this directly
no test coverage detected