stateFilePath returns the path to the local state file.
()
| 150 | |
| 151 | // stateFilePath returns the path to the local state file. |
| 152 | func stateFilePath() (string, error) { |
| 153 | home, err := os.UserHomeDir() |
| 154 | if err != nil { |
| 155 | return "", fmt.Errorf("error getting user home dir: %v", err) |
| 156 | } |
| 157 | dir := filepath.Join(home, ".local", "resourcectl") |
| 158 | if err := os.MkdirAll(dir, 0755); err != nil { |
| 159 | return "", fmt.Errorf("error creating state dir: %v", err) |
| 160 | } |
| 161 | return filepath.Join(dir, "state.json"), nil |
| 162 | } |
| 163 | |
| 164 | // stateLockFilePath returns the path to the local state lock file. |
| 165 | func stateLockFilePath() (string, error) { |
searching dependent graphs…