Skip to content

A platform for community discussion. Free, open, simple.

DEV: Skip pnpm install in bin/qunit if already up-to-date (#37921)

David Taylorc177877b39da
diff --git a/bin/ember-cli b/bin/ember-cli
index 8b7b4998cea..a45adc3d228 100755
--- a/bin/ember-cli
+++ b/bin/ember-cli
@@ -59,7 +59,7 @@ end
node_modules_outdated =
begin
File.read("node_modules/.pnpm/lock.yaml") != File.read("pnpm-lock.yaml")
- rescue ERRNO::ENOENT
+ rescue Errno::ENOENT
true
end
diff --git a/bin/qunit b/bin/qunit
index d5c78914966..7ed03d5b684 100755
--- a/bin/qunit
+++ b/bin/qunit
@@ -394,7 +394,15 @@ class QunitRunner
puts "[dry-run] skipping pnpm install"
return
end
- system("pnpm", "install", exception: true)
+
+ node_modules_outdated =
+ begin
+ File.read("node_modules/.pnpm/lock.yaml") != File.read("pnpm-lock.yaml")
+ rescue Errno::ENOENT
+ true
+ end
+
+ system("pnpm", "install", exception: true) if node_modules_outdated
end
def detect_browser