]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
workflow: alert user working on repo if not using yarn (#1237)
authorlimichange <limichange@hotmail.com>
Tue, 9 Jun 2020 21:36:45 +0000 (05:36 +0800)
committerGitHub <noreply@github.com>
Tue, 9 Jun 2020 21:36:45 +0000 (17:36 -0400)
package.json
scripts/checkYarn.js [new file with mode: 0644]

index a38b05a6b23a60ea167fd10ce9dffcb74ded0e8d..331d5fdf2c5cbbc601efb161d302621c5cad5492 100644 (file)
@@ -16,7 +16,8 @@
     "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
     "dev-compiler": "npm-run-all --parallel \"dev template-explorer\" serve",
     "serve": "serve",
-    "open": "open http://localhost:5000/packages/template-explorer/local.html"
+    "open": "open http://localhost:5000/packages/template-explorer/local.html",
+    "preinstall": "node ./scripts/checkYarn.js"
   },
   "types": "test-dts/index.d.ts",
   "tsd": {
diff --git a/scripts/checkYarn.js b/scripts/checkYarn.js
new file mode 100644 (file)
index 0000000..19d9f51
--- /dev/null
@@ -0,0 +1,5 @@
+if (!/yarn\.js$/.test(process.env.npm_execpath || '')) {
+  console.warn(
+    "\u001b[33mYou don't seem to be using yarn. This could produce unexpected results.\u001b[39m"
+  )
+}