Socket
Socket
Sign inDemoInstall

snyk-gradle-plugin

Package Overview
Dependencies
Maintainers
1
Versions
141
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snyk-gradle-plugin - npm Package Compare versions

Comparing version 2.12.3 to 2.12.4

48

dist/index.js

@@ -165,12 +165,14 @@ "use strict";

}
function getAllDeps(root, targetFile, options) {
function getInjectedScriptPath() {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
let initGradlePath = null;
let initGradleAsset = null;
if (/index.js$/.test(__filename)) {
// running from ./dist
initGradlePath = path.join(__dirname, '../lib/init.gradle');
// path.join call has to be exactly in this format, needed by "pkg" to build a standalone Snyk CLI binary:
// https://www.npmjs.com/package/pkg#detecting-assets-in-source-code
initGradleAsset = path.join(__dirname, '../lib/init.gradle');
}
else if (/index.ts$/.test(__filename)) {
// running from ./lib
initGradlePath = path.join(__dirname, 'init.gradle');
initGradleAsset = path.join(__dirname, 'init.gradle');
}

@@ -180,11 +182,9 @@ else {

}
const args = buildArgs(root, targetFile, initGradlePath, options);
// We could be running from a bundled CLI generated by `pkg`.
// The Node filesystem in that case is not real: https://github.com/zeit/pkg#snapshot-filesystem
// Copying the injectable script into a temp file.
let tmpInitGradle = null;
try {
tmpInitGradle = tmp.fileSync({ postfix: '-init.gradle' });
yield fs.createReadStream(initGradlePath).pipe(fs.createWriteStream('', { fd: tmpInitGradle.fd }));
initGradlePath = tmpInitGradle.name;
const tmpInitGradle = tmp.fileSync({ postfix: '-init.gradle' });
fs.createReadStream(initGradleAsset).pipe(fs.createWriteStream('', { fd: tmpInitGradle.fd }));
return { injectedScripPath: tmpInitGradle.name, cleanupCallback: tmpInitGradle.removeCallback };
}

@@ -196,3 +196,19 @@ catch (error) {

}
});
}
function getAllDeps(root, targetFile, options) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const command = getCommand(root, targetFile);
let gradleVersionOutput = '[COULD NOT RUN gradle -v] ';
try {
gradleVersionOutput = yield subProcess.execute(command, ['-v'], { cwd: root });
}
catch (_) {
// intentionally empty
}
if (gradleVersionOutput.match(/Gradle 1/)) {
throw new Error('Gradle 1.x is not supported');
}
const { injectedScripPath, cleanupCallback } = yield getInjectedScriptPath();
const args = buildArgs(root, targetFile, injectedScripPath, options);
const fullCommandText = 'gradle command: ' + command + ' ' + args.join(' ');

@@ -202,4 +218,4 @@ debugLog('Executing ' + fullCommandText);

const stdoutText = yield subProcess.execute(command, args, { cwd: root }, printIfEcho);
if (tmpInitGradle !== null) {
tmpInitGradle.removeCallback();
if (cleanupCallback) {
cleanupCallback();
}

@@ -212,12 +228,2 @@ return extractJsonFromScriptOutput(stdoutText);

const gradleErrorEssence = error.message.split('\n').filter((l) => gradleErrorMarkers.test(l)).join('\n');
// It'd be nice to set it in the inner catch{} block below.
// However, it's not safe: the inner catch{} will be executed even it inner try{}
// succeeds. Seems like an async/await implementation problem.
let gradleVersionOutput = '[COULD NOT RUN gradle -v] ';
try {
gradleVersionOutput = yield subProcess.execute(command, ['-v'], { cwd: root });
}
catch (_) {
// intentionally empty
}
const orange = chalk_1.default.rgb(255, 128, 0);

@@ -224,0 +230,0 @@ const blackOnYellow = chalk_1.default.bgYellowBright.black;

@@ -49,3 +49,3 @@ {

},
"version": "2.12.3"
"version": "2.12.4"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc