warn if metadata not found

pull/2982/head
yann300 2 years ago
parent 867fbbcde8
commit 7db0067d4d
  1. 10
      libs/remixd/src/services/foundryClient.ts

@ -120,7 +120,14 @@ export class FoundryClient extends PluginClient {
// extract source and version
const metadata = contentJSON.metadata
if (metadata.compiler && metadata.compiler.version) {
compilationResultPart.solcVersion = metadata.compiler.version
} else {
compilationResultPart.solcVersion = ''
console.log('\x1b[32m%s\x1b[0m', 'compiler version not found, please update Foundry to the latest version.')
}
if (metadata.sources) {
for (const path in metadata.sources) {
const absPath = utils.absolutePath(path, this.currentSharedFolder)
try {
@ -130,6 +137,9 @@ export class FoundryClient extends PluginClient {
compilationResultPart.input[path] = { content: '' }
}
}
} else {
console.log('\x1b[32m%s\x1b[0m', 'sources input not found, please update Foundry to the latest version.')
}
compilationResultPart.compilationTarget = contentJSON.ast.absolutePath

Loading…
Cancel
Save