check for truffle config file

pull/2265/head
Aniket-Engg 3 years ago committed by yann300
parent 032b490fdc
commit 7bb5b2e1cb
  1. 7
      libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts
  2. 21
      libs/remixd/src/bin/remixd.ts

@ -110,10 +110,9 @@ export class CompileTabLogic {
}
async isTruffleProject () {
return true
// if (this.api.getFileManagerMode() === 'localhost') {
// return await this.api.fileExists('truffle.config.js')
// } else return false
if (this.api.getFileManagerMode() === 'localhost') {
return await this.api.fileExists('truffle-config.js')
} else return false
}
runCompiler (externalCompType) {

@ -102,15 +102,18 @@ function errorHandler (error: any, service: string) {
sharedFolderClient.setWebSocket(ws)
sharedFolderClient.sharedFolder(program.sharedFolder)
})
startService('truffle', (ws: WS, sharedFolderClient: servicesList.Sharedfolder, error: any) => {
if (error) {
errorHandler(error, 'truffle')
return false
}
sharedFolderClient.setWebSocket(ws)
sharedFolderClient.sharedFolder(program.sharedFolder)
})
// Run truffle service if a truffle project is shared as folder
const truffleConfigFilePath = absolutePath('./', program.sharedFolder) + '/truffle-config.js'
if (existsSync(truffleConfigFilePath)) {
startService('truffle', (ws: WS, sharedFolderClient: servicesList.Sharedfolder, error: any) => {
if (error) {
errorHandler(error, 'truffle')
return false
}
sharedFolderClient.setWebSocket(ws)
sharedFolderClient.sharedFolder(program.sharedFolder)
})
}
// Run hardhat service if a hardhat project is shared as folder
const hardhatConfigFilePath = absolutePath('./', program.sharedFolder)
const isHardhatProject = existsSync(hardhatConfigFilePath + '/hardhat.config.js') || existsSync(hardhatConfigFilePath + '/hardhat.config.ts')

Loading…
Cancel
Save