No pnpm dlx

This commit is contained in:
Joseph Garrone 2024-06-28 18:50:45 +02:00
parent bdde9162d9
commit 1edd6e4193
2 changed files with 17 additions and 0 deletions

View File

@ -10,8 +10,11 @@ import { getThemeSrcDirPath } from "../getThemeSrcDirPath";
import { getThisCodebaseRootDirPath } from "../tools/getThisCodebaseRootDirPath";
import { readThisNpmProjectVersion } from "../tools/readThisNpmProjectVersion";
import { keycloakifyBuildOptionsForPostPostBuildScriptEnvName } from "../constants";
import { assertNoPnpmDlx } from "../tools/assertNoPnpmDlx";
export async function main() {
assertNoPnpmDlx();
const buildOptions = readBuildOptions({
"processArgv": process.argv.slice(2)
});

View File

@ -0,0 +1,14 @@
import { sep as pathSep } from "path";
export function assertNoPnpmDlx() {
if (__dirname.includes(`${pathSep}pnpm${pathSep}dlx${pathSep}`)) {
console.log(
[
"Please don't use `pnpm dlx keycloakify`. Even if you're using pnpm as a package manager",
"use `npx keycloakify` or `pnpm exec keycloakify` instead since you want to use the keycloakify version that is installed in your project and",
"not the latest version on NPM."
].join(" ")
);
process.exit(1);
}
}