MCPcopy Index your code
hub / github.com/jetify-com/devbox / shouldCreateFile

Method shouldCreateFile

internal/plugin/plugin.go:233–252  ·  view source on GitHub ↗
(
	pkg *lock.Package,
	filePath string,
)

Source from the content-addressed store, hash-verified

231}
232
233func (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
254func (c *Config) Description() string {
255 if c == nil {

Callers 1

CreateFilesForConfigMethod · 0.95

Calls 1

IsMethod · 0.80

Tested by

no test coverage detected