Switched from execFile to spawn.

So that we can add guards against whitespaces in the path.
Also cleaned up the code a bit.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta
2019-10-24 15:53:55 +02:00
parent 4353bfb5b9
commit 3efb5a4e08
7 changed files with 70 additions and 68 deletions

View File

@@ -94,7 +94,7 @@ export class SketchesServiceImpl implements SketchesService {
const sketchDir = path.join(parent, sketchName)
const sketchFile = path.join(sketchDir, `${sketchName}.ino`);
fs.mkdirSync(sketchDir);
fs.mkdirpSync(sketchDir);
fs.writeFileSync(sketchFile, `
void setup() {
// put your setup code here, to run once: