Skip to content

Commit

Permalink
feat: add integration env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
sandor-trombitas committed Jul 26, 2024
1 parent 1836618 commit 1161daf
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ts-binary-wrapper/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const binaryDeploymentsFilePath = path.join(
'generated',
'binary-deployments.json',
);
export const integrationName = 'TS_BINARY_WRAPPER';

export class WrapperConfiguration {
private version: string;
Expand Down Expand Up @@ -191,6 +192,11 @@ export function runWrapper(executable: string, cliArguments: string[]): number {
const res = spawnSync(executable, cliArguments, {
shell: false,
stdio: 'inherit',
env: {
...process.env,
SNYK_INTEGRATION_NAME: integrationName,
SNYK_INTEGRATION_VERSION: getCurrentVersion(versionFile),
},
});

if (res.status !== null) {
Expand Down Expand Up @@ -253,7 +259,7 @@ export function downloadExecutable(
filenameShasum: string,
): Promise<Error | undefined> {
return new Promise<Error | undefined>(function(resolve) {
const options = new URL(downloadUrl + '?utm_source=npm');
const options = new URL(`${downloadUrl}?utm_source=${integrationName}`);
const temp = path.join(__dirname, Date.now().toString());
const fileStream = fs.createWriteStream(temp);
const shasum = createHash('sha256').setEncoding('hex');
Expand Down

0 comments on commit 1161daf

Please sign in to comment.