warn if metadata not found

pull/5370/head
yann300 2 years ago
parent d9252633ae
commit 713e620b1e
  1. 10
      libs/remixd/src/services/foundryClient.ts

@ -120,7 +120,14 @@ export class FoundryClient extends PluginClient {
// extract source and version // extract source and version
const metadata = contentJSON.metadata const metadata = contentJSON.metadata
if (metadata.compiler && metadata.compiler.version) {
compilationResultPart.solcVersion = 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) { for (const path in metadata.sources) {
const absPath = utils.absolutePath(path, this.currentSharedFolder) const absPath = utils.absolutePath(path, this.currentSharedFolder)
try { try {
@ -130,6 +137,9 @@ export class FoundryClient extends PluginClient {
compilationResultPart.input[path] = { content: '' } 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 compilationResultPart.compilationTarget = contentJSON.ast.absolutePath

Loading…
Cancel
Save