Commit 02effc55 authored by yann300's avatar yann300

fix deleting reports

parent 91da1ef0
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
import * as WS from 'ws' // eslint-disable-line import * as WS from 'ws' // eslint-disable-line
import { PluginClient } from '@remixproject/plugin' import { PluginClient } from '@remixproject/plugin'
import { existsSync, readFileSync, readdirSync } from 'fs' import { existsSync, readFileSync, readdirSync, unlink } from 'fs'
import { OutputStandard } from '../types' // eslint-disable-line import { OutputStandard } from '../types' // eslint-disable-line
const { spawn, execSync, unlink } = require('child_process') const { spawn, execSync } = require('child_process')
export class SlitherClient extends PluginClient { export class SlitherClient extends PluginClient {
methods: Array<string> methods: Array<string>
...@@ -151,8 +151,12 @@ export class SlitherClient extends PluginClient { ...@@ -151,8 +151,12 @@ export class SlitherClient extends PluginClient {
let report = readFileSync(outputFileAbsPath, 'utf8') let report = readFileSync(outputFileAbsPath, 'utf8')
report = JSON.parse(report) report = JSON.parse(report)
try { try {
unlink(outputFileAbsPath) unlink(outputFileAbsPath, (err) => {
} catch (e) {} console.log(err)
})
} catch (e) {
console.log(e)
}
if (report['success']) { if (report['success']) {
response['status'] = true response['status'] = true
if (!report['results'] || !report['results'].detectors || !report['results'].detectors.length) { if (!report['results'] || !report['results'].detectors || !report['results'].detectors.length) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment