mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
chore(NA): exit early with link for docs when using kbn_pm on windows (#139745)
This PR allow us to print an error message with a link to the docs when using kbn_pm on Windows outside of a WSL environment. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Spencer <spencer@elastic.co>
This commit is contained in:
parent
c3adc5b29c
commit
7242c1a6c7
2 changed files with 23 additions and 0 deletions
|
@ -18,6 +18,7 @@
|
|||
import { Args } from './lib/args.mjs';
|
||||
import { getHelp } from './lib/help.mjs';
|
||||
import { createFlagError, isCliError } from './lib/cli_error.mjs';
|
||||
import { checkIfRunningNativelyOnWindows } from './lib/windows.mjs';
|
||||
import { getCmd } from './commands/index.mjs';
|
||||
import { Log } from './lib/log.mjs';
|
||||
import External from './lib/external_packages.js';
|
||||
|
@ -40,6 +41,7 @@ async function tryToGetCiStatsReporter(log) {
|
|||
}
|
||||
|
||||
try {
|
||||
checkIfRunningNativelyOnWindows(log);
|
||||
const cmd = getCmd(cmdName);
|
||||
|
||||
if (cmdName && !cmd) {
|
||||
|
|
21
kbn_pm/src/lib/windows.mjs
Normal file
21
kbn_pm/src/lib/windows.mjs
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
||||
* or more contributor license agreements. Licensed under the Elastic License
|
||||
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
||||
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
||||
* Side Public License, v 1.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {import('./log.mjs').Log} log
|
||||
*/
|
||||
export function checkIfRunningNativelyOnWindows(log) {
|
||||
if (process.platform !== 'win32') {
|
||||
return;
|
||||
}
|
||||
|
||||
log.error(
|
||||
'We no longer support natively bootstrap Kibana on Windows. Please check our documentation on how you can develop on Windows at https://docs.elastic.dev/kibana-dev-docs/tutorial/setup-windows-development-wsl'
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue