I have a postinstall node script that copies previously run scripts into my npm-scripts folder. However, this only works for Mac. I need to have it work for Windows as well so I am creating a new file that will run 1 for windows or the one listed below for Mac.
`cp ../node_modules/some-components/npm-scripts/*.js ../npm_scripts`
copy.js file which performs the copy platform-independently via a Node.js API (i.e. do not rely on Windows or Unix-specific shell commands
copy). My suggestion: Use
fs-extra, which also handles copying directories, in contrast to the included
var fs = require('fs-extra'); // add to your dependencies via 'npm install fs-extra --save' var path = require('path'); fs.copySync( path.resolve(__dirname, '../path/to/source', path.resolve(__dirname, '../path/to/destination'));