check if build dir exists

pull/3039/head
Aniket-Engg 2 years ago committed by Aniket
parent 3df7d872a1
commit c7f7efadf9
  1. 5
      libs/remix-core-plugin/src/lib/compiler-metadata.ts

@ -50,7 +50,9 @@ export class CompilerMetadata extends Plugin {
// Access each file in build-info, check the input sources
// If they are all same as in current compiled file and sources includes the path of compiled file, remove old build file
async removeStoredBuildInfo (currentInput, path, filePath) {
const allBuildFiles = await this.call('fileManager', 'fileList', this.joinPath(path, this.innerPath, 'build-info/'))
const buildDir = this.joinPath(path, this.innerPath, 'build-info/')
if (await this.call('fileManager', 'exists', buildDir)) {
const allBuildFiles = await this.call('fileManager', 'fileList', buildDir)
const currentInputFileNames = Object.keys(currentInput.sources)
for (const fileName of allBuildFiles) {
let fileContent = await this.call('fileManager', 'readFile', fileName)
@ -60,6 +62,7 @@ export class CompilerMetadata extends Plugin {
if (inputIntersection.length === 0 && inputFiles.includes(filePath)) await this.call('fileManager', 'remove', fileName)
}
}
}
async setBuildInfo (version, input, output, path, filePath) {
input = JSON.parse(input)

Loading…
Cancel
Save