GoogleChromeLabs / carlo

Web rendering surface for Node applications
Apache License 2.0
9.31k stars 309 forks source link

examples/photobooth saveImage on Windows (quick fix) #89

Closed ab35 closed 5 years ago

ab35 commented 5 years ago

On windows operating systems, the method toISOString() does not produce a valid filesystem path:

const fileName = path.join('pictures', new Date().toISOString() + '.jpeg');

A quick fix that solves the issue:

const fileName = path.join('pictures', `${new Date().toISOString().replace(/:/g,'-')}.jpeg`);
pavelfeldman commented 5 years ago

Thanks. https://github.com/GoogleChromeLabs/carlo/commit/ac0271a6ea21d4cefa51605e4bcba375053b7e8c