Commit 2ba9333c authored by 0mkar's avatar 0mkar

resolve via callback

parent fcff184a
......@@ -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) {
......
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment