check for truffle config file

pull/5370/head
Aniket-Engg 3 years ago committed by yann300
parent be606d043f
commit 05f612010d
  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 () { async isTruffleProject () {
return true if (this.api.getFileManagerMode() === 'localhost') {
// if (this.api.getFileManagerMode() === 'localhost') { return await this.api.fileExists('truffle-config.js')
// return await this.api.fileExists('truffle.config.js') } else return false
// } else return false
} }
runCompiler (externalCompType) { runCompiler (externalCompType) {

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

Loading…
Cancel
Save