mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-09 22:24:05 -08:00
ci: Block execution of npm install
(no-changelog) (#4662)
ci: block execution of `npm install` (no-changelog)
This commit is contained in:
parent
60746dc92e
commit
6b52e4b111
|
@ -9,6 +9,7 @@
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@7.14.2",
|
"packageManager": "pnpm@7.14.2",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"preinstall": "node scripts/block-npm-install.js",
|
||||||
"build": "turbo run build",
|
"build": "turbo run build",
|
||||||
"dev": "turbo run dev --parallel",
|
"dev": "turbo run dev --parallel",
|
||||||
"clean": "turbo run clean --parallel",
|
"clean": "turbo run clean --parallel",
|
||||||
|
|
12
scripts/block-npm-install.js
Normal file
12
scripts/block-npm-install.js
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
const { npm_config_user_agent: UA } = process.env;
|
||||||
|
const [packageManager] = (UA ?? '').split(' ');
|
||||||
|
const [name, version] = packageManager.split('/');
|
||||||
|
if (name !== 'pnpm') {
|
||||||
|
const suggestion = '\033[1;92mpnpm\033[0;31m';
|
||||||
|
console.error('\033[0;31m');
|
||||||
|
console.error('╭───────────────────────────────────────────╮');
|
||||||
|
console.error(`│\tPlease use ${suggestion} instead of ${name} \t │`);
|
||||||
|
console.error('╰───────────────────────────────────────────╯');
|
||||||
|
console.error('\033[0m');
|
||||||
|
process.exit(1);
|
||||||
|
}
|
Loading…
Reference in a new issue