From 485b8ef558db6cfc7978db399196508139ef8956 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Mon, 19 Nov 2018 15:36:31 -0500 Subject: [PATCH] fix: handle contracts being removed Fixes #1077 --- src/lib/core/config.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/core/config.js b/src/lib/core/config.js index 0da7c8166..e9629267c 100644 --- a/src/lib/core/config.js +++ b/src/lib/core/config.js @@ -59,6 +59,12 @@ var Config = function(options) { }; self.contractsFiles.push(new File({filename, type: File.types.custom, path: filename, resolver})); }); + + self.events.on('file-remove', (fileType, removedPath) => { + if(fileType !== 'contract') return; + const normalizedPath = path.normalize(removedPath); + self.contractsFiles = self.contractsFiles.filter(file => path.normalize(file.filename) !== normalizedPath); + }); }; Config.prototype.loadConfigFiles = function(options) {