I would like to create a package.json
build script that executes slightly different set of commands when run from Windows, Linux, Mac.
The problem is that I cannot find a way to put it in package.json
file that will run without problems at every system.
Here is an example that I would like to have:
"scripts" : {
"build.windows" : "echo do windows specific stuff",
"build.linux" : "echo do linux specific stuff",
"build.mac" : "echo do mac specific stuff",
"build" : "??????????????" <- what to put here to execute script designed for OS
on which npm is running
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…