From b85cd35bc9ca5e44c4eaddebbbdc08285bba2895 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 4 Dec 2023 13:33:27 +0530 Subject: [PATCH 1/3] remove empty lines from remappings --- .../solidity-compiler/src/lib/logic/compileTabLogic.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts b/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts index 941296597e..437e929a55 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts +++ b/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts @@ -111,8 +111,8 @@ export class CompileTabLogic { this.event.emit('removeAnnotations') this.event.emit('startingCompilation') if(await this.api.fileExists('remappings.txt')) { - this.api.readFile('remappings.txt').then( remappings => { - this.compiler.set('remappings', remappings.split('\n')) + this.api.readFile('remappings.txt').then(remappings => { + this.compiler.set('remappings', remappings.split('\n').filter(Boolean)) }) } if (this.configFilePath) { From 37628d23f12800ddc8fdccf6f6e7aa8a0025264b Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 4 Dec 2023 14:02:55 +0530 Subject: [PATCH 2/3] reset remappings in case of file deletion --- .../solidity-compiler/src/lib/logic/compileTabLogic.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts b/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts index 437e929a55..ba55cbb752 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts +++ b/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts @@ -112,9 +112,9 @@ export class CompileTabLogic { this.event.emit('startingCompilation') if(await this.api.fileExists('remappings.txt')) { this.api.readFile('remappings.txt').then(remappings => { - this.compiler.set('remappings', remappings.split('\n').filter(Boolean)) + this.compiler.set('remappings', remappings.split('\n')) }) - } + } else this.compiler.set('remappings', []) if (this.configFilePath) { this.api.readFile(this.configFilePath).then( contentConfig => { this.compiler.set('configFileContent', contentConfig) From 08e88760cad1fae107b2d88b0850bddd8fe349b9 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Mon, 4 Dec 2023 18:12:19 +0530 Subject: [PATCH 3/3] add filter again --- .../remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts b/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts index ba55cbb752..958ef3a06a 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts +++ b/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts @@ -112,7 +112,7 @@ export class CompileTabLogic { this.event.emit('startingCompilation') if(await this.api.fileExists('remappings.txt')) { this.api.readFile('remappings.txt').then(remappings => { - this.compiler.set('remappings', remappings.split('\n')) + this.compiler.set('remappings', remappings.split('\n').filter(Boolean)) }) } else this.compiler.set('remappings', []) if (this.configFilePath) {