This commit is contained in:
parent
dbae909903
commit
c5ef4c973b
@ -12,6 +12,10 @@ import * as os from "os";
|
||||
import { rmSync } from "../tools/fs.rmSync";
|
||||
|
||||
export async function command(params: { cliCommandOptions: CliCommandOptions }) {
|
||||
const { cliCommandOptions } = params;
|
||||
|
||||
const buildContext = getBuildContext({ cliCommandOptions });
|
||||
|
||||
exit_if_maven_not_installed: {
|
||||
let commandOutput: Buffer | undefined = undefined;
|
||||
|
||||
@ -25,6 +29,22 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
||||
break exit_if_maven_not_installed;
|
||||
}
|
||||
|
||||
if (
|
||||
fs
|
||||
.readFileSync(buildContext.packageJsonFilePath)
|
||||
.toString("utf8")
|
||||
.includes(`"mvn"`)
|
||||
) {
|
||||
console.log(
|
||||
chalk.red(
|
||||
[
|
||||
"Please remove the 'mvn' package from your package.json'dependencies list,",
|
||||
"reinstall your dependencies and try again.",
|
||||
"We need the Apache Maven CLI, not this: https://www.npmjs.com/package/mvn"
|
||||
].join(" ")
|
||||
)
|
||||
);
|
||||
} else {
|
||||
const installationCommand = (() => {
|
||||
switch (os.platform()) {
|
||||
case "darwin":
|
||||
@ -42,14 +62,11 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
||||
installationCommand
|
||||
)}\` (for example)`
|
||||
);
|
||||
}
|
||||
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const { cliCommandOptions } = params;
|
||||
|
||||
const buildContext = getBuildContext({ cliCommandOptions });
|
||||
|
||||
console.log(
|
||||
[
|
||||
chalk.cyan(`keycloakify v${readThisNpmPackageVersion()}`),
|
||||
|
Loading…
x
Reference in New Issue
Block a user