parent
ffd6ac95a0
commit
099b4a0053
@ -1,4 +1,5 @@ |
||||
export { RemixdClient as Sharedfolder } from './services/remixdClient' |
||||
export { GitClient } from './services/gitClient' |
||||
export { HardhatClient } from './services/hardhatClient' |
||||
export { TruffleClient } from './services/truffleClient' |
||||
export { SlitherClient } from './services/slitherClient' |
||||
|
@ -0,0 +1,31 @@ |
||||
import * as WS from 'ws' // eslint-disable-line
|
||||
import { PluginClient } from '@remixproject/plugin' |
||||
const { spawn } = require('child_process') // eslint-disable-line
|
||||
|
||||
export class TruffleClient extends PluginClient { |
||||
methods: Array<string> |
||||
websocket: WS |
||||
currentSharedFolder: string |
||||
|
||||
constructor (private readOnly = false) { |
||||
super() |
||||
this.methods = ['compile'] |
||||
} |
||||
|
||||
setWebSocket (websocket: WS): void { |
||||
this.websocket = websocket |
||||
} |
||||
|
||||
sharedFolder (currentSharedFolder: string): void { |
||||
this.currentSharedFolder = currentSharedFolder |
||||
} |
||||
|
||||
compile (configPath: string) { |
||||
return new Promise((resolve, reject) => { |
||||
if (this.readOnly) { |
||||
const errMsg = '[Truffle Compilation]: Cannot compile in read-only mode' |
||||
return reject(new Error(errMsg)) |
||||
} |
||||
}) |
||||
} |
||||
} |
Loading…
Reference in new issue