Skip to content

Commit

Permalink
inline inject-tracer.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Brignull committed Aug 26, 2020
1 parent 1f2bd10 commit e9bfa56
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 12 deletions.
13 changes: 12 additions & 1 deletion lib/init.js

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

2 changes: 1 addition & 1 deletion lib/init.js.map

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

14 changes: 13 additions & 1 deletion src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,22 @@ export async function runInit(
const tracerConfig = await getCombinedTracerConfig(config, codeql);
if (tracerConfig !== undefined) {
if (process.platform === 'win32') {
const injectTracerPath = path.join(config.tempDir, 'inject-tracer.ps1');
fs.writeFileSync(injectTracerPath, `
Param(
[Parameter(Position=0)]
[String]
$tracer
)
Get-Process -Name Runner.Worker
$process=Get-Process -Name Runner.Worker
$id=$process.Id
Invoke-Expression "&$tracer --inject=$id"`);

await exec.exec(
'powershell',
[
path.resolve(__dirname, '..', 'src', 'inject-tracer.ps1'),
injectTracerPath,
path.resolve(path.dirname(codeql.getPath()), 'tools', 'win64', 'tracer.exe'),
],
{ env: { 'ODASA_TRACER_CONFIGURATION': tracerConfig.spec } });
Expand Down
9 changes: 0 additions & 9 deletions src/inject-tracer.ps1

This file was deleted.

0 comments on commit e9bfa56

Please sign in to comment.