DEV Community

Discussion on: Create Node Command line App

Collapse
 
drozerah profile image
Drozerah

Hi Austin, could you try to explain the choice of .execSync() rather than the Node build-in fs.mkdir() to create the '/usr/bin/oc' path ? Sometimes command lines differs from one 0S to an other for the same result... fs.mkdir() will result the same on every plateforms, am I wrong ?

Collapse
 
austincunningham profile image
Austin Cunningham

Correct fs would work as well,I don't generally think about Windows these days. childprocess also has an option to for shell which can you can run the command from a windows shell, but you would have to handle the os detection , so fs is a better option.