From 7358b5c322f5ba815fbce45676c756ca2a582cc8 Mon Sep 17 00:00:00 2001 From: Devon Stewart Date: Fri, 2 Aug 2024 16:21:49 -0700 Subject: [PATCH] Even reproducable package managers should force a reinstall if the package dir does not exist --- internal/cli/cmds.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/cli/cmds.go b/internal/cli/cmds.go index 0cd9a2bd..0b57ad10 100644 --- a/internal/cli/cmds.go +++ b/internal/cli/cmds.go @@ -241,7 +241,11 @@ func maybeInstall(ctx context.Context, b api.LanguageBackend, forceInstall bool) if !util.Exists(b.Lockfile) { return } - if forceInstall || store.HasLockfileChanged(b) { + var needsPackageDir bool + if packageDir := b.GetPackageDir(); packageDir != "" { + needsPackageDir = !util.Exists(packageDir) + } + if forceInstall || store.HasSpecfileChanged(b) || needsPackageDir { b.Install(ctx) } } else {