fix all clients

pull/3285/head
filip mertens 2 years ago committed by Aniket
parent 1fb994f9f4
commit b37476cd05
  1. 3
      libs/remixd/src/services/foundryClient.ts
  2. 5
      libs/remixd/src/services/hardhatClient.ts
  3. 21
      libs/remixd/src/services/truffleClient.ts

@ -45,9 +45,8 @@ export class FoundryClient extends PluginClient {
try {
this.watcher = chokidar.watch(this.currentSharedFolder, { depth: 1, ignorePermissionErrors: true, ignoreInitial: true })
// watch for new folders
this.watcher.on('addDir', (path) => {
this.watcher.on('addDir', () => {
if (fs.existsSync(this.buildPath) && fs.existsSync(this.cachePath)) {
this.buildPath = path
this.listenOnFoundryCompilation()
}
})

@ -125,9 +125,8 @@ export class HardhatClient extends PluginClient {
try {
this.watcher = chokidar.watch(this.currentSharedFolder, { depth: 1, ignorePermissionErrors: true, ignoreInitial: true })
// watch for new folders
this.watcher.on('addDir', (path) => {
if (path.endsWith('artifacts/contracts')) {
this.buildPath = path
this.watcher.on('addDir', () => {
if (fs.existsSync(this.buildPath)) {
this.listenOnHardhatCompilation()
}
})

@ -30,7 +30,26 @@ export class TruffleClient extends PluginClient {
sharedFolder (currentSharedFolder: string): void {
this.currentSharedFolder = currentSharedFolder
this.buildPath = utils.absolutePath('build/contracts', this.currentSharedFolder)
this.listenOnTruffleCompilation()
if (fs.existsSync(this.buildPath)) {
this.listenOnTruffleCompilation()}
else {
console.log('Truffle build folder doesn\'t exist... waiting for the first compilation.')
this.listenOnTruffleFolder()
}
}
listenOnTruffleFolder () {
try {
this.watcher = chokidar.watch(this.currentSharedFolder, { depth: 1, ignorePermissionErrors: true, ignoreInitial: true })
// watch for new folders
this.watcher.on('addDir', () => {
if (fs.existsSync(this.buildPath)) {
this.listenOnTruffleCompilation()
}
})
} catch (e) {
console.log(e)
}
}
compile (configPath: string) {

Loading…
Cancel
Save