snyk-gradle-plugin
Advanced tools
Comparing version 2.10.4 to 2.11.0
@@ -11,2 +11,5 @@ "use strict"; | ||
const chalk_1 = require("chalk"); | ||
const debugModule = require("debug"); | ||
// To enable debugging output, run the CLI as `DEBUG=snyk-gradle-plugin snyk ...` | ||
const debugLogging = debugModule('snyk-gradle-plugin'); | ||
const packageFormatVersion = 'mvn:0.0.1'; | ||
@@ -136,2 +139,11 @@ function isMultiSubProject(options) { | ||
} | ||
const reEcho = /^SNYKECHO (.*)$/; | ||
function printIfEcho(line) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
const maybeMatch = reEcho.exec(line); | ||
if (maybeMatch) { | ||
debugLogging(maybeMatch[1]); | ||
} | ||
}); | ||
} | ||
function getAllDeps(root, targetFile, options) { | ||
@@ -186,3 +198,3 @@ return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
try { | ||
const stdoutText = yield subProcess.execute(command, args, { cwd: root }); | ||
const stdoutText = yield subProcess.execute(command, args, { cwd: root }, printIfEcho); | ||
if (tmpInitGradle !== null) { | ||
@@ -189,0 +201,0 @@ tmpInitGradle.removeCallback(); |
export declare function execute(command: string, args: string[], options: { | ||
cwd?: string; | ||
}): Promise<string>; | ||
}, perLineCallback?: (s: string) => Promise<void>): Promise<string>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const childProcess = require("child_process"); | ||
function execute(command, args, options) { | ||
const debugModule = require("debug"); | ||
const debugLogging = debugModule('snyk-gradle-plugin'); | ||
// Executes a subprocess. Resolves successfully with stdout contents if the exit code is 0. | ||
function execute(command, args, options, perLineCallback) { | ||
const spawnOptions = { shell: true }; | ||
@@ -14,3 +17,7 @@ if (options && options.cwd) { | ||
proc.stdout.on('data', (data) => { | ||
stdout = stdout + data; | ||
const strData = data.toString(); | ||
stdout = stdout + strData; | ||
if (perLineCallback) { | ||
strData.split('\n').forEach(perLineCallback); | ||
} | ||
}); | ||
@@ -32,3 +39,6 @@ proc.stderr.on('data', (data) => { | ||
} | ||
resolve(stdout || stderr); | ||
if (stderr) { | ||
debugLogging('subprocess exit code = 0, but stderr was not empty: ' + stderr); | ||
} | ||
resolve(stdout); | ||
}); | ||
@@ -35,0 +45,0 @@ }); |
@@ -38,8 +38,10 @@ { | ||
"dependencies": { | ||
"@types/debug": "^4.1.4", | ||
"chalk": "^2.4.2", | ||
"clone-deep": "^0.3.0", | ||
"debug": "^4.1.1", | ||
"tmp": "0.0.33", | ||
"tslib": "^1.9.3" | ||
}, | ||
"version": "2.10.4" | ||
"version": "2.11.0" | ||
} |
Sorry, the diff of this file is not supported yet
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
37126
428
6
+ Added@types/debug@^4.1.4
+ Addeddebug@^4.1.1
+ Added@types/debug@4.1.12(transitive)
+ Added@types/ms@0.7.34(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addedms@2.1.3(transitive)