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

Function createSymlink

internal/plugin/plugin.go:215–231  ·  view source on GitHub ↗
(root, filePath string)

Source from the content-addressed store, hash-verified

213}
214
215func createSymlink(root, filePath string) error {
216 name := filepath.Base(filePath)
217 newname := filepath.Join(root, VirtenvBinPath, name)
218
219 // Create bin path just in case it doesn't exist
220 if err := os.MkdirAll(filepath.Join(root, VirtenvBinPath), 0o755); err != nil {
221 return errors.WithStack(err)
222 }
223
224 if _, err := os.Lstat(newname); err == nil {
225 if err = os.Remove(newname); err != nil {
226 return errors.WithStack(err)
227 }
228 }
229
230 return errors.WithStack(os.Symlink(filePath, newname))
231}
232
233func (m *Manager) shouldCreateFile(
234 pkg *lock.Package,

Callers 1

createFileMethod · 0.85

Calls 1

RemoveMethod · 0.45

Tested by

no test coverage detected