Skip to content

Commit

Permalink
fix: reinitialize on change to truffle config
Browse files Browse the repository at this point in the history
  • Loading branch information
kanej committed Apr 14, 2023
1 parent 61800da commit cf96685
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions server/src/frameworks/Truffle/TruffleProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,16 +238,15 @@ export class TruffleProject extends Project {
public async onWatchedFilesChanges({
changes,
}: DidChangeWatchedFilesParams): Promise<void> {
for (const change of changes) {
if (this.configPath === change.uri) {
this.serverState.logger.info(
`Reinitializing truffle project: ${this.id()}`
);

await this.initialize();
}
if (!changes.some((change) => change.uri.endsWith(this.configPath))) {
return;
}
return;

this.serverState.logger.info(
`Reinitializing truffle project: ${this.id()}`
);

await this.initialize();
}

private async _resolveDeployedAddresses(): Promise<string> {
Expand Down

0 comments on commit cf96685

Please sign in to comment.