resolve via callback

pull/5370/head
0mkar 6 years ago
parent c414bdce55
commit 10440f1761
  1. 3
      remix-resolve/src/combineSource.js
  2. 1
      remix-resolve/src/getFile.js
  3. 2
      remix-resolve/tests/test.js

@ -28,7 +28,8 @@ const combineSource = async function (rootpath, sources) {
let subSorce = {}
const response = await resolve(rootpath, fn)
// sources[fileName].content = sources[fileName].content.replace(importLine, 'import' + extra + ' \'' + response.filename + '\';')
subSorce[fn] = { content: response.content }
const regex = /(\.+\/)/g
subSorce[fn.replace(regex, '')] = { content: response.content }
sources = Object.assign(await combineSource(response.rootpath, subSorce), sources)
}
} catch (e) {

@ -1,4 +1,5 @@
const getFile = function (path, sources) {
// return sources[path].content
return sources[path].content
}

@ -165,7 +165,7 @@ describe('testRunner', function () {
const findImportsSync = function (path) {
console.log(path)
console.log(sources)
// return rr.getFile(path, sources)
return rr.getFile(path, combinedSources)
}
try {
results = solc.compile(JSON.stringify(input), findImportsSync)

Loading…
Cancel
Save