Commit e29ea30e authored by Iuri Matias's avatar Iuri Matias

refactor condition

parent 7409c3aa
...@@ -15,17 +15,11 @@ function compileFileOrFiles (filename, isDirectory, cb) { ...@@ -15,17 +15,11 @@ function compileFileOrFiles (filename, isDirectory, cb) {
// TODO: for now assumes filepath dir contains all tests, later all this // TODO: for now assumes filepath dir contains all tests, later all this
// should be replaced with remix's & browser solidity compiler code // should be replaced with remix's & browser solidity compiler code
if (isDirectory) { filepath = (isDirectory ? filename : path.dirname(filename))
filepath = filename
fs.readdirSync(filename).forEach(file => {
sources[file] = {content: fs.readFileSync(path.join(filename, file)).toString()}
})
} else {
filepath = path.dirname(filename)
fs.readdirSync(filepath).forEach(file => { fs.readdirSync(filepath).forEach(file => {
sources[file] = {content: fs.readFileSync(path.join(filepath, file)).toString()} sources[file] = {content: fs.readFileSync(path.join(filepath, file)).toString()}
}) })
}
async.waterfall([ async.waterfall([
function loadCompiler (next) { function loadCompiler (next) {
......
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