From ab1d596e7e31f4aa2aa0f2f66843600e739b9aeb Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Thu, 27 Aug 2020 13:32:58 +0530 Subject: [PATCH] CLI with relative path --- libs/remix-solidity/src/compiler/compiler.ts | 3 +-- libs/remix-tests/src/compiler.ts | 2 +- libs/remix-tests/src/run.ts | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/remix-solidity/src/compiler/compiler.ts b/libs/remix-solidity/src/compiler/compiler.ts index 4cbd963d8b..daff161536 100644 --- a/libs/remix-solidity/src/compiler/compiler.ts +++ b/libs/remix-solidity/src/compiler/compiler.ts @@ -130,10 +130,9 @@ export class Compiler { onCompilationFinished (data: CompilationResult, missingInputs?: string[], source?: SourceWithTarget): void { let noFatalErrors = true // ie warnings are ok - const checkIfFatalError = (error: CompilationError) => { // Ignore warnings and the 'Deferred import' error as those are generated by us as a workaround - const isValidError = (error.message && error.message=== 'Deferred import') ? false : error.severity !== 'warning' + const isValidError = (error.message && error.message.includes('Deferred import')) ? false : error.severity !== 'warning' if(isValidError) noFatalErrors = false } if (data.error) checkIfFatalError(data.error) diff --git a/libs/remix-tests/src/compiler.ts b/libs/remix-tests/src/compiler.ts index c14ba4080b..08b8393a6e 100644 --- a/libs/remix-tests/src/compiler.ts +++ b/libs/remix-tests/src/compiler.ts @@ -129,7 +129,7 @@ export function compileFileOrFiles(filename: string, isDirectory: boolean, opts: ], function (err: Error | null | undefined, result: any) { const error: Error[] = [] if (result.error) error.push(result.error) - const errors = (result.errors || error).filter((e) => e.type === 'Error' || e.severity === 'error') + const errors = (result.errors || error).filter((e) => (e.type === 'Error' || e.severity === 'error')) if (errors.length > 0) { if (!isBrowser) require('signale').fatal(errors) return cb(new CompilationErrors(errors)) diff --git a/libs/remix-tests/src/run.ts b/libs/remix-tests/src/run.ts index 7422ee2a43..93725d02ad 100644 --- a/libs/remix-tests/src/run.ts +++ b/libs/remix-tests/src/run.ts @@ -1,5 +1,6 @@ import commander from 'commander' import Web3 from 'web3'; +import path from 'path' import { runTestFiles } from './runTestFiles' import fs from './fileSystem' import { Provider } from '@remix-project/remix-simulator' @@ -58,7 +59,7 @@ commander } const isDirectory = fs.lstatSync(filename).isDirectory() - runTestFiles(filename, isDirectory, web3) + runTestFiles(path.resolve(filename), isDirectory, web3) }) if (!process.argv.slice(2).length) {