|
|
@ -67,16 +67,21 @@ export class SlitherClient extends PluginClient { |
|
|
|
// Get compiler version without commit id e.g: 0.8.2
|
|
|
|
// Get compiler version without commit id e.g: 0.8.2
|
|
|
|
const version: string = versionString.substring(0, versionString.indexOf('+commit')) |
|
|
|
const version: string = versionString.substring(0, versionString.indexOf('+commit')) |
|
|
|
// List solc versions installed using solc-select
|
|
|
|
// List solc versions installed using solc-select
|
|
|
|
const solcSelectInstalledVersions: Buffer = execSync('solc-select versions', options) |
|
|
|
try { |
|
|
|
// Check if required version is already installed
|
|
|
|
const solcSelectInstalledVersions: Buffer = execSync('solc-select versions', options) |
|
|
|
if (!solcSelectInstalledVersions.toString().includes(version)) { |
|
|
|
// Check if required version is already installed
|
|
|
|
console.log('\x1b[32m%s\x1b[0m', `[Slither Analysis]: Installing ${version} using solc-select`) |
|
|
|
if (!solcSelectInstalledVersions.toString().includes(version)) { |
|
|
|
// Install required version
|
|
|
|
console.log('\x1b[32m%s\x1b[0m', `[Slither Analysis]: Installing ${version} using solc-select`) |
|
|
|
execSync(`solc-select install ${version}`, options) |
|
|
|
// Install required version
|
|
|
|
|
|
|
|
execSync(`solc-select install ${version}`, options) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
console.log('\x1b[32m%s\x1b[0m', `[Slither Analysis]: Setting ${version} as current solc version using solc-select`) |
|
|
|
|
|
|
|
// Set solc current version as required version
|
|
|
|
|
|
|
|
execSync(`solc-select use ${version}`, options) |
|
|
|
|
|
|
|
} catch (err) { |
|
|
|
|
|
|
|
console.log(err) |
|
|
|
|
|
|
|
reject(new Error('Error in running solc-select command')) |
|
|
|
} |
|
|
|
} |
|
|
|
console.log('\x1b[32m%s\x1b[0m', `[Slither Analysis]: Setting ${version} as current solc version using solc-select`) |
|
|
|
|
|
|
|
// Set solc current version as required version
|
|
|
|
|
|
|
|
execSync(`solc-select use ${version}`, options) |
|
|
|
|
|
|
|
} else console.log('\x1b[32m%s\x1b[0m', '[Slither Analysis]: Compiler version is same as installed solc version') |
|
|
|
} else console.log('\x1b[32m%s\x1b[0m', '[Slither Analysis]: Compiler version is same as installed solc version') |
|
|
|
} |
|
|
|
} |
|
|
|
const outputFile: string = 'remix-slitherReport_' + Date.now() + '.json' |
|
|
|
const outputFile: string = 'remix-slitherReport_' + Date.now() + '.json' |
|
|
|