refactor condition

pull/7/head
Iuri Matias 7 years ago
parent 7409c3aaac
commit e29ea30e1a
  1. 10
      src/compiler.js

@ -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) {

Loading…
Cancel
Save