Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lock when there isnt a package dir either #214

Merged
merged 2 commits into from
Jan 18, 2024

Conversation

cdmistman
Copy link
Contributor

Why

There's still some scenarios when upm lock doesn't happen. Right now the heuristic is:

  1. --force flag is passed
  2. lockfile doesn't exist
  3. specfile has changed

We should also run if the package dir doesn't exist

What Changed

if the 3 above conditions are all false, then also check to see if backend.GetPackageDir() returns a path, and if that path doesn't exist.

Testing

test suite :)

for manual testing:

  1. create a npm package
  2. add a dependency and lock (however you choose to do this, doesn't matter)
  3. rm -rdf node_modules if it exists
  4. upm lock should recreate the node_modules dir

@cdmistman cdmistman requested a review from a team as a code owner January 18, 2024 19:37
@cdmistman cdmistman requested review from blast-hardcheese and removed request for a team January 18, 2024 19:37
@cdmistman cdmistman marked this pull request as draft January 18, 2024 19:37
@cdmistman cdmistman marked this pull request as ready for review January 18, 2024 20:07
Copy link
Collaborator

@blast-hardcheese blast-hardcheese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

@cdmistman cdmistman merged commit 2ba794f into main Jan 18, 2024
3 checks passed
@cdmistman cdmistman deleted the cad/lock-when-no-package-dir-either branch January 18, 2024 20:38
@blast-hardcheese blast-hardcheese added the bug Something isn't working label Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants