Last active
May 23, 2019 06:18
-
-
Save abhisekp/0194e499d265e6b536fa737cb70b3eb1 to your computer and use it in GitHub Desktop.
No Yarn Check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const errorMessage = ` | |
❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌ | |
👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇 | |
Use yarn. It is blazingly faster ⚡⚡⚡ | |
Install yarn - https://yarnpkg.com/en/docs/install | |
- yarn add [package] # Install a package as dependency | |
- yarn add [package] --dev # Install a package as dev dependency | |
👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆 | |
❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌ | |
`; | |
// Check if npm_execpath ends with yarn.js i.e. yarn is used | |
if (!/yarn\.js$/.test(process.env.npm_execpath)) { | |
console.log(errorMessage); | |
process.exit(1); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
const errorMessage = ` | |
❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌ | |
👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇👇 | |
Use npm please although yarn is blazingly faster ⚡⚡⚡ | |
- npm install --save [package] # Install a package as dependency | |
- npm install --save-dev [package] # Install a package as dev dependency | |
👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆👆 | |
❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌❌ | |
`; | |
// Check if npm_execpath ends with yarn.js i.e. yarn is used | |
if (!/npm(-cli)?\.js$/.test(process.env.npm_execpath)) { | |
console.log(errorMessage); | |
process.exit(1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment