Toolkit: fix grafana-toolkit binary path so toolkit is not run in linked mode (#25860)

This commit is contained in:
Dominik Prokop 2020-06-26 10:45:39 -07:00 committed by GitHub
parent fb3bec058a
commit 75706a4a8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,8 +23,9 @@ const isLinkedMode = () => {
};
const entrypoint = () => {
const resolvedJsDir = path.resolve(`${__dirname}/../dist/src/cli/index.js`);
const resolvedTsDir = path.resolve(`${__dirname}/../src/cli/index.ts`);
const entrypointBase = `${__dirname}/../src/cli/index`;
const resolvedJsDir = path.resolve(`${entrypointBase}.js`);
const resolvedTsDir = path.resolve(`${entrypointBase}.ts`);
// IF we have a toolkit directory AND linked grafana toolkit AND the toolkit dir is a symbolic lik
// THEN run everything in linked mode
@ -46,4 +47,3 @@ const entrypoint = () => {
};
require(entrypoint()).run(includeInternalScripts);