Skip to content

Commit 5f446dd

Browse files
authored
Add config for dbt deps (#1565)
1 parent 4a30ac4 commit 5f446dd

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@
121121
"type": "number",
122122
"description": "By default how much lineage should expand.",
123123
"default": 1
124+
},
125+
"dbt.installDepsOnProjectInitialization": {
126+
"type": "boolean",
127+
"description": "Install dbt deps on project initialization",
128+
"default": true
124129
}
125130
}
126131
},

src/manifest/dbtProject.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,12 @@ export class DBTProject implements Disposable {
523523
project: this,
524524
inProgress: true,
525525
});
526-
if (!this.depsInitialized) {
526+
const installDepsOnProjectInitialization = workspace
527+
.getConfiguration("dbt")
528+
.get<boolean>("installDepsOnProjectInitialization", true);
529+
if (!this.depsInitialized && installDepsOnProjectInitialization) {
527530
try {
528-
await this.installDeps();
531+
await this.installDeps(true);
529532
} catch (error: any) {
530533
// this is best effort
531534
console.warn("An error occured while installing dependencies", error);
@@ -655,10 +658,13 @@ export class DBTProject implements Disposable {
655658
);
656659
}
657660

658-
async installDeps() {
661+
async installDeps(silent = false) {
659662
this.telemetry.sendTelemetryEvent("installDeps");
660663
const installDepsCommand =
661664
this.dbtCommandFactory.createInstallDepsCommand();
665+
if (silent) {
666+
installDepsCommand.focus = false;
667+
}
662668
return this.dbtProjectIntegration.deps(installDepsCommand);
663669
}
664670

0 commit comments

Comments
 (0)