Commit a0717fba authored by 0mkar's avatar 0mkar Committed by yann300

fix conflicts

parent be872671
......@@ -37,11 +37,21 @@ function compileFileOrFiles (filename, isDirectory, opts, cb) {
// TODO: for now assumes filepath dir contains all tests, later all this
// should be replaced with remix's & browser solidity compiler code
// This logic is wrong
// We should only look into current file if a full file name with path is given
// We should only walk through directory if a directory name is passed
try {
// walkSync only if it is a directory
// https://github.com/mikeal/node-utils/blob/master/file/lib/main.js
fs.walkSync = function (start, callback) {
fs.readdirSync(start).forEach(name => {
if (name === 'node_modules') {
return; // hack
}
var abspath = path.join(start, name);
if (fs.statSync(abspath).isDirectory()) {
fs.walkSync(abspath, callback);
} else {
callback(abspath);
}
});
};
fs.walkSync(filepath, foundpath => {
// only process .sol files
if (foundpath.split('.').pop() === 'sol') {
......@@ -53,9 +63,7 @@ function compileFileOrFiles (filename, isDirectory, opts, cb) {
sources[foundpath] = { content: c }
}
})
} catch (e) {
throw e
} finally {
async.waterfall([
function loadCompiler (next) {
compiler = new RemixCompiler()
......@@ -68,7 +76,7 @@ function compileFileOrFiles (filename, isDirectory, opts, cb) {
compiler.event.register('compilationFinished', this, function (success, data, source) {
next(null, data)
})
compiler.compile(sources, filepath)
compiler.compile(sources, false)
}
], function (err, result) {
let errors = (result.errors || []).filter((e) => e.type === 'Error' || e.severity === 'error')
......@@ -78,7 +86,6 @@ function compileFileOrFiles (filename, isDirectory, opts, cb) {
}
cb(err, result.contracts)
})
}
}
function compileContractSources (sources, importFileCb, opts, cb) {
......
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