fix: handle contracts being removed

Fixes #1077
This commit is contained in:
Andre Medeiros 2018-11-19 15:36:31 -05:00 committed by Pascal Precht
parent ab41860d9b
commit 485b8ef558
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D

View File

@ -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) {