I have a node container that is running nodemon. I have a windows and mac dev laptop. Due to issues outlined here https://stackoverflow.com/a/39239884/2532762, the windows machine has to fallback on a very innefficient polling method to watch for changes. But I want to leave any unix style hosts to run without a flag. I want the container to run one of 2 scripts depending on the host OS.
I can't find a proper way to access this information from within the container.
This is the gist of the script I want to use
const dockerHostIsWindows = "" //<---??
const pollingFlag = dockerHostIsWindows ? "--legacy-watch --polling-interval 1000" : ""
const command = `../node_modules/.bin/nodemon ${pollingFlag} --config nodemon.json --inspect=0.0.0.0:9229 ./server.ts`
const child = exec(command, { cwd: __dirname }, (error, stdout, stderr) => {
})