initCloudDir creates the service status directory and a .gitignore file
(projectDir, hostID string)
| 93 | |
| 94 | // initCloudDir creates the service status directory and a .gitignore file |
| 95 | func initCloudDir(projectDir, hostID string) error { |
| 96 | cloudDirPath := cloudFilePath(projectDir) |
| 97 | _ = os.MkdirAll(filepath.Join(cloudDirPath, hostID), 0o755) |
| 98 | gitignorePath := filepath.Join(cloudDirPath, ".gitignore") |
| 99 | _, err := os.Stat(gitignorePath) |
| 100 | if !errors.Is(err, fs.ErrNotExist) { |
| 101 | return nil |
| 102 | } |
| 103 | return errors.WithStack(os.WriteFile(gitignorePath, []byte("*"), 0o644)) |
| 104 | } |
| 105 | |
| 106 | type ServiceStatus struct { |
| 107 | LocalPort string `json:"local_port"` |
no test coverage detected