BelaPlatform / Bela

Bela: core code, IDE and lots of fun!
Other
490 stars 139 forks source link

IDE does not work if `projects/` folder does not exist #159

Closed giuliomoro closed 3 years ago

giuliomoro commented 7 years ago

If the projects folder does not exist, you start the IDE and you cannot even display or load examples. The IDE log gives this sort of things (alternating between "can't find projects/basic" and "can't find projects/" :

{ Error: ENOENT: no such file or directory, scandir '/root/Bela/projects/basic/'
    at Error (native)
  cause:
   { Error: ENOENT: no such file or directory, scandir '/root/Bela/projects/basic/'
       at Error (native)
     errno: -2,
     code: 'ENOENT',
     syscall: 'scandir',
     path: '/root/Bela/projects/basic/' },
  isOperational: true,
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/root/Bela/projects/basic/' }
{ Error: ENOENT: no such file or directory, scandir '/root/Bela/projects/'
    at Error (native)
  cause:
   { Error: ENOENT: no such file or directory, scandir '/root/Bela/projects/'
       at Error (native)
     errno: -2,
     code: 'ENOENT',
     syscall: 'scandir',
     path: '/root/Bela/projects/' },
  isOperational: true,
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/root/Bela/projects/' }

expected behaviour: it should either print a warning or anyhow not hang (e.g.: it could create the projects folder itself).

LBDonovan commented 7 years ago

It would only be realistic to check for this on startup, otherwise we're adding a lot of extra CPU usage for checking every folder exists every time it is used.

I don't think it's unreasonable for the IDE to expect a certain file structure and fail if it doesn't find it. But a decent error message would be nice at least.

giuliomoro commented 7 years ago

sure you could just issue a mkdir -p $YOURBELAFOLDER/projects at startup .

giuliomoro commented 7 years ago

@LBDonovan I think this was fixed?

giuliomoro commented 6 years ago

Nope.

Dec 20 20:16:46 bela node[12852]: { Error: ENOENT: no such file or directory, scandir '/root/Bela/projects/'
Dec 20 20:16:46 bela node[12852]:   cause:
Dec 20 20:16:46 bela node[12852]:    { Error: ENOENT: no such file or directory, scandir '/root/Bela/projects/'
Dec 20 20:16:46 bela node[12852]:      errno: -2,
Dec 20 20:16:46 bela node[12852]:      code: 'ENOENT',
Dec 20 20:16:46 bela node[12852]:      syscall: 'scandir',
Dec 20 20:16:46 bela node[12852]:      path: '/root/Bela/projects/' },
Dec 20 20:16:46 bela node[12852]:   isOperational: true,
Dec 20 20:16:46 bela node[12852]:   errno: -2,
Dec 20 20:16:46 bela node[12852]:   code: 'ENOENT',
Dec 20 20:16:46 bela node[12852]:   syscall: 'scandir',
Dec 20 20:16:46 bela node[12852]:   path: '/root/Bela/projects/' }