@@ -10,7 +10,7 @@ import {
1010 remove ,
1111} from "fs-extra" ;
1212import path , { basename , join } from "path" ;
13- import { Uri , window } from "vscode" ;
13+ import { Uri , window , workspace } from "vscode" ;
1414import type { CodeQLCliServer } from "../codeql-cli/cli" ;
1515import type { App } from "../common/app" ;
1616import { createTimeoutSignal } from "../common/fetch-stream" ;
@@ -442,6 +442,19 @@ export class RemoteLogs {
442442 execFileSync ( "tar" , [ "-xzf" , tarballPath , "-C" , untarPath ] ) ;
443443 }
444444
445+ private getDca ( ) : { bin : string ; config : string } {
446+ const dcaDir = workspace . getConfiguration ( ) . get ( "codeql-dca.dir" ) ;
447+ if ( typeof dcaDir !== "string" ) {
448+ throw new Error (
449+ 'codeql-dca.dir not set in workspace configuration. Can not process remote logs without it. Solution: insert `"codeql-dca.dir": "/Users/esbena/Documents/codeql-dca"` into your `settings.json` and try again.' ,
450+ ) ;
451+ }
452+ return {
453+ bin : path . join ( dcaDir , "dca" ) ,
454+ config : path . join ( dcaDir , "dca-config.yml" ) ,
455+ } ;
456+ }
457+
445458 private async getPotentialTargetInfos (
446459 experimentName : string ,
447460 ) : Promise < Array < MinimalDownloadsType [ "targets" ] [ "string" ] > > {
@@ -450,13 +463,13 @@ export class RemoteLogs {
450463 ) ;
451464 const tasksDir = join ( dir , "tasks" ) ;
452465 await ensureDir ( tasksDir ) ;
453- // XXX hardcoded path
454- const dca = "/Users/esbena/Documents/codeql-dca/dca" ;
455- const config = "/Users/esbena/Documents/codeql-dca/dca-config.yml" ;
456- execFileSync ( dca , [
466+
467+ const dca = this . getDca ( ) ;
468+
469+ execFileSync ( dca . bin , [
457470 "tasks-remote" ,
458471 "--config" ,
459- config ,
472+ dca . config ,
460473 "--mode" ,
461474 "get-tasks" ,
462475 "--name" ,
@@ -465,10 +478,10 @@ export class RemoteLogs {
465478 dir ,
466479 ] ) ;
467480 const downloadsFile = join ( dir , "downloads.json" ) ;
468- execFileSync ( dca , [
481+ execFileSync ( dca . bin , [
469482 "tasks-show" ,
470483 "--config" ,
471- config ,
484+ dca . config ,
472485 "--mode" ,
473486 "downloads" ,
474487 "--output" ,
0 commit comments