vscode-codeql/extensions/ql-vscode/gulpfile.ts/appInsights.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 строки
619 B
TypeScript
Исходник Обычный вид История

import { src, dest } from "gulp";
2022-03-30 00:09:01 +03:00
// eslint-disable-next-line @typescript-eslint/no-var-requires
const replace = require("gulp-replace");
/** Inject the application insights key into the telemetry file */
export function injectAppInsightsKey() {
if (!process.env.APP_INSIGHTS_KEY) {
// noop
console.log(
"APP_INSIGHTS_KEY environment variable is not set. So, cannot inject it into the application.",
);
return Promise.resolve();
}
// replace the key
return src(["out/extension.js"])
.pipe(replace(/REPLACE-APP-INSIGHTS-KEY/, process.env.APP_INSIGHTS_KEY))
.pipe(dest("out/"));
}