Skip to content

Commit

Permalink
Revert changes. (#1280)
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonWeber authored Feb 16, 2024
1 parent 3882ee9 commit 561b23f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
11 changes: 2 additions & 9 deletions Bootstrap/Helpers.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
import { DiagnosticLog, DiagnosticMessageId } from "./DataModel";
import { DiagnosticLogger } from "./DiagnosticLogger";
import { isWindows, isLinux } from "../Library/PrefixHelper";

export function sdkAlreadyExists(_logger: DiagnosticLogger): boolean {
try {
// appInstance should either resolve to user SDK or crash. If it resolves to attach SDK, user probably modified their NODE_PATH
let appInstance: string;
try {
// Node 8.9+ Windows
if (isWindows()) {
appInstance = (require.resolve as any)("applicationinsights", { paths: [process.cwd()] });
}
// Node 8.9+ Linux
else if (isLinux()) {
appInstance = `${process.cwd()}${(require.resolve as any)("applicationinsights", { paths: [process.cwd()] })}`;
}
// Node 8.9+
appInstance = (require.resolve as any)("applicationinsights", { paths: [process.cwd()] });
} catch (e) {
// Node <8.9
appInstance = require.resolve(process.cwd() + "/node_modules/applicationinsights");
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@
},
"dependencies": {
"@azure/core-auth": "^1.5.0",
"@azure/core-util": "1.2.0",
"@azure/core-rest-pipeline": "1.10.1",
"@azure/core-util": "1.2.0",
"@azure/opentelemetry-instrumentation-azure-sdk": "^1.0.0-beta.5",
"@microsoft/applicationinsights-web-snippet": "^1.0.1",
"@microsoft/applicationinsights-web-snippet": "1.0.1",
"@opentelemetry/api": "^1.7.0",
"@opentelemetry/core": "^1.19.0",
"@opentelemetry/sdk-trace-base": "^1.19.0",
Expand Down

0 comments on commit 561b23f

Please sign in to comment.