fabric8-analytics-lsp-server
Advanced tools
Comparing version 0.4.26 to 0.4.27
@@ -17,2 +17,4 @@ 'use strict'; | ||
const child_process_1 = require("child_process"); | ||
const path_1 = require("path"); | ||
const url_1 = require("url"); | ||
/* Please note :: There was issue with semverRegex usage in the code. During run time, it extracts | ||
@@ -85,3 +87,3 @@ * version with 'v' prefix, but this is not be behavior of semver in CLI and test environment. | ||
entry.value_position = { line: index + 1, column: version.index }; | ||
// Push all direct and indirect modules present in go.mod (manifest) | ||
// Push all direct and indirect modules present in go.mod (manifest) | ||
dependencies.push(new collector_1.Dependency(entry)); | ||
@@ -143,6 +145,8 @@ } | ||
let promiseExec = new Promise((resolve, reject) => { | ||
const vscodeRootpath = this.manifestFile.replace("file://", "").replace("/go.mod", ""); | ||
child_process_1.exec(utils_1.getGoLangImportsCmd(), { shell: process.env["SHELL"], windowsHide: true, cwd: vscodeRootpath, maxBuffer: 1024 * 1200 }, (error, stdout, stderr) => { | ||
const sourceRootPath = url_1.fileURLToPath(path_1.dirname(this.manifestFile)); | ||
const cmd = utils_1.getGoLangImportsCmd(); | ||
console.info(`Root path : '${sourceRootPath}' Cmd : '${cmd}'`); | ||
child_process_1.exec(cmd, { windowsHide: true, cwd: sourceRootPath, maxBuffer: 1024 * 1200 }, (error, stdout, stderr) => { | ||
if (error) { | ||
console.error(`Command failed, environment SHELL: [${process.env["SHELL"]}] PATH: [${process.env["PATH"]}] CWD: [${process.env["CWD"]}]`); | ||
console.error(`Command error [${error}], PATH: [${process.env["PATH"]}] CWD: [${sourceRootPath}] CMD: [${cmd}]`); | ||
if (error.code == 127) { // Invalid command, go executable not found | ||
@@ -156,3 +160,3 @@ reject(`Unable to locate '${config_1.config.golang_executable}'`); | ||
else { | ||
resolve(new Set(stdout.toString().split("\n"))); | ||
resolve(new Set(stdout.toString().replace("[", "").replace("]", "").split(" "))); | ||
} | ||
@@ -159,0 +163,0 @@ }); |
@@ -47,4 +47,4 @@ /* -------------------------------------------------------------------------------------------- | ||
exports.getGoLangImportsCmd = () => { | ||
return `${config_1.config.golang_executable} list -mod=readonly -f '{{ join .Imports "\\n" }}' ./...`; | ||
return `${config_1.config.golang_executable} list -mod=readonly -f "{{.Imports}}" ./...`; | ||
}; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "fabric8-analytics-lsp-server", | ||
"description": "LSP Server for Dependency Analytics", | ||
"version": "0.4.26", | ||
"version": "0.4.27", | ||
"author": "Pavel Odvody", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
111836
1162
2