( pkg *lock.Package, filePath string, )
| 231 | } |
| 232 | |
| 233 | func (m *Manager) shouldCreateFile( |
| 234 | pkg *lock.Package, |
| 235 | filePath string, |
| 236 | ) bool { |
| 237 | sep := string(filepath.Separator) |
| 238 | |
| 239 | // Only create files in devbox.d directory if they are not in the lockfile |
| 240 | pluginInstalled := pkg != nil && pkg.PluginVersion != "" |
| 241 | if strings.Contains(filePath, sep+devboxDirName+sep) && pluginInstalled { |
| 242 | return false |
| 243 | } |
| 244 | |
| 245 | // Hidden .devbox files are always replaceable, so ok to recreate |
| 246 | if strings.Contains(filePath, sep+devboxHiddenDirName+sep) { |
| 247 | return true |
| 248 | } |
| 249 | _, err := os.Stat(filePath) |
| 250 | // File doesn't exist, so we should create it. |
| 251 | return errors.Is(err, fs.ErrNotExist) |
| 252 | } |
| 253 | |
| 254 | func (c *Config) Description() string { |
| 255 | if c == nil { |
no test coverage detected