check if file exists

pull/2262/head
yann300 3 years ago
parent 42c4a36e8c
commit 042302c521
  1. 5
      apps/remix-ide/src/app/tabs/compile-and-run.ts

@ -50,6 +50,11 @@ export class CompileAndRun extends Plugin {
async runScript (fileName, clearAllInstances) {
await this.call('terminal', 'log', `running ${fileName} ...`)
try {
const exists = await this.call('fileManager', 'exists', fileName)
if (!exists) {
await this.call('terminal', 'log', `${fileName} does not exist.`)
return
}
const content = await this.call('fileManager', 'readFile', fileName)
if (clearAllInstances) {
await this.call('udapp', 'clearAllInstances')

Loading…
Cancel
Save