install slither using remixd

pull/2450/head
Aniket-Engg 3 years ago
parent be68c729ab
commit 70de15b1e8
  1. 7
      libs/remixd/src/bin/remixd.ts
  2. 6
      libs/remixd/src/services/slitherClient.ts

@ -63,6 +63,7 @@ function errorHandler (error: any, service: string) {
.description('Establish a two-way websocket connection between the local computer and Remix IDE for a folder')
.option('-u, --remix-ide <url>', 'URL of remix instance allowed to connect')
.option('-s, --shared-folder <path>', 'Folder to share with Remix IDE (Default: CWD)')
.option('-i, --install <name>', 'Module name to install locally')
.option('-r, --read-only', 'Treat shared folder as read-only (experimental)')
.on('--help', function () {
console.log('\nExample:\n\n remixd -s ./shared_project -u http://localhost:8080')
@ -71,6 +72,12 @@ function errorHandler (error: any, service: string) {
await warnLatestVersion()
if(program.install && !program.readOnly) {
const availableModulesToInstall = ['slither']
const service = program.install
if(availableModulesToInstall.includes(program.install)) services[service](false)['install']()
}
if (!program.remixIde) {
console.log('\x1b[33m%s\x1b[0m', '[WARN] You can only connect to remixd from one of the supported origins.')
} else {

@ -14,7 +14,7 @@ export class SlitherClient extends PluginClient {
constructor (private readOnly = false) {
super()
this.methods = ['analyse']
this.methods = ['analyse', 'install']
}
setWebSocket (websocket: WS): void {
@ -25,6 +25,10 @@ export class SlitherClient extends PluginClient {
this.currentSharedFolder = currentSharedFolder
}
install (): void {
console.log('inside slither install method')
}
mapNpmDepsDir (list) {
const remixNpmDepsPath = utils.absolutePath('.deps/npm', this.currentSharedFolder)
const localNpmDepsPath = utils.absolutePath('node_modules', this.currentSharedFolder)

Loading…
Cancel
Save