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

Method StoreName

internal/devpkg/package.go:634–644  ·  view source on GitHub ↗

StoreName returns the last section of the store path. Example: nix/store/abc123-foo-1.0.0 -> foo-1.0.0 Warning, this is probably slowish. If you need to call this multiple times, consider caching the result.

()

Source from the content-addressed store, hash-verified

632// Warning, this is probably slowish. If you need to call this multiple times,
633// consider caching the result.
634func (p *Package) StoreName() (string, error) {
635 u, err := p.urlForInstall()
636 if err != nil {
637 return "", err
638 }
639 name, err := nix.EvalPackageName(u)
640 if err != nil {
641 return "", err
642 }
643 return name, nil
644}
645
646func (p *Package) EnsureUninstallableIsInLockfile() error {
647 // TODO savil: Should !p.isInstallable() be the opposite i.e. p.IsInstallable()?

Callers 1

Calls 2

urlForInstallMethod · 0.95
EvalPackageNameFunction · 0.92

Tested by

no test coverage detected